full anagram functionality