finalized calculator formulas