completed calculations and unit tests