Modified procedure for checking wether number is palindrome