updated logic in anagrams