Factored out the code for checking all iterations into checkTargetedIterations()
Factored out the code for checking all iterations into checkTargetedIterations()

Also made some aesthetic changes to the code and documented the functions.

racetted/maestro,racetted/maestro