Trying to fix adaptive step size