added anagram sorting