Loop optimization.
Merge pull request #1 from Ranzear/master

Loop optimization.