refactored anagram.rb: renamed count_letters to letter_frequency