docstring for optimize_steps