Updated calc to use sympy rather than my own half-baked solution.