Calc sum and output