Filled in part of calc.c