add palindrome algorithm