started to build out caclulation code