the calculations in queries.sql are now correct, we still need to implement the payments