removed manual implementation of palindrome check