anagrams checking via sorted strings