fixed issue#176 - Nested for loops variable declarations are same

Small fix for making sure nested for loops are unique variables.