Anagram compacting