anagram creation algorithm improving