fix glitch where debts were being calculated inversely