Updated with adaptive RK4