solved the palindrome problem using recursion