updated for multiple odes.