refactored Calc v2.0