fixed all calculations and setup integrated tests for calculations.