Stage 3: loops
code cleanup and documentation