generalize integrator, use flags, make everything work as intended