backtracking to determine step size