Move loop variable definition into loop headers
Merge pull request #205 from Dmitry-Me/moveDefinitionsToLoopHeaders

Move loop variable definition into loop headers