For loop optimization

For loops were not caching the length of the loop
Merge pull request #22 from acconrad/patch-1

For loop optimization