change palindrome function