add the gradient searching steps