Optimize loops
Merge pull request #17 from Theriault/patch-1

Optimize loops