palindrome update.
update the algorithm to get the palindrome elements.