fixed error in integrator. removed unused code