palindrome num reimpl