Removing variable re-declaration.
Using local var in loop.