added palindrome check