Better palindrome solution