to test if a string input is a palindrome