calculating purchases with payments 6445