Improvements to the looping constructs
Merge branch 'feature/loops'