added check palindrome algorithm