Louise Rains wrote: > q.inject(Array.new(4,0)){ |h,e| if e < 10000 then h[Math.log10(e).to_i] > +=1 } You need an "end" to go with the "if .. then .. " : q.inject(Array.new(4,0)){ |h,e| if e < 10000 then h[Math.log10(e).to_i] +=1; end }