Anagram purification