added reverse a string, check if palindrome