Modifications to run() to improve clarity and readability. The max_iterations param now accepts 0 to mean no limit of iterations.