It's only a redefinition if you do it in the same scope. Each function is a different scope and can have local variables with the same name as a variable in Global scope.
You just have to be careful about your use of variables.
And don't give global variables stupid names like 'i'.