Made variables unsigned longs. Added saveData function to source