To check for palindrome