a bunch of calculations for the final submission