Implementing a palindrome solution