Changed to a simpler version of reverse_num.c