updated solution for anagrams - switch key and value for a hashtable did the trick