Function def moved above the ode call