tidy up t he calc.js