Integrator fully working + code cleanup