Fixed palindrome function