implement palindrome exercise