implement adapt stepsize