reverse an integer