function fitting now works with scipy/sympy