Updated rhs and integrator to use typesafe pointer passing