anagram check for strings done with two methods