calculate who should pay whom