Implementing palindrome test