Updated: defined the functions within the Calc.