Use each_with_object in word_count