Made complete anagram algorithm work