check if a word is a palindrome