Adding isPalindrome function