work input and palindrome check