Anagram optimizations