Anagram termination