Updated palindromeA method.