initial answer for word-count in ruby