Global loop variable changed to local
Merge pull request #1 from mgechev/master

Global changed to local