Changed the allInts function to be tail-recursive.