add tail treatment for step size computation