refact code for palindrom number