algorithm and reverseInteger work