More work on integrator.cpp