From: junkone@... Date: 2006-07-30T12:30:11+09:00 Subject: not sure what is wrong. seems to look right to me class ReportBuilder countExch=Hash.new def getStats(symbolObjColl) startCounter=0 #### add a loop to count thro symbolcollection. symbolObjColl.each{|eachSymbolObj| if (countExch.has_key?(eachSymbolObj.exchange)) countExch[eachSymbolObj.exchange]=countExch[eachSymbolObj.exchange]+=1 else countExch[eachSymbolObj.exchange]=startCounter+=1; end } puts countExch.to_s end end I get the folliwng error. 1) Error: Test_ReportBuilder#test_Case1: NameError: undefined local variable or method `countExch' for # I am not sure what is wrong. Seede