Improves the loop.

Adds functionality to the loop.