Loop ending should be coupled to the loop tighter for clarity.
Merge pull request #80 from Dmitry-Me/refactorloop

Loop ending should be coupled to the loop tighter for clarity.