added anagram algorithm