function for working out if a number is a palindrome
reversing an int is handy too