updated anagram check to ignore spaces and punctuation