Changed code that calls RK4 to calculate as little as possible