added factor separation and very simple ode solving