Now program works with one step of comparing anagram