Changed XPTable to a long int, included stdlib and stdio into the mix