Fixed Step 4, with correct results. Need to keep 'nil' for keeping track of records. Need to fix rounding errors
Clean up