included the integrator in the main function