draft of anagram algo