full calculation