Word Counter written in Ruby