Completed isPalindrome