modify the palindrome code