Figuring out who owes who what