working version of the integrator but not validated yet