stack and palindrome alg