added method to check if 2 strings are anagrams