added implementation of an algorithm for anagram detection