Removed a strange var declaration and renamed loop var.

Renaming the loop var gets rid of the 'warning' about duplicate variable assignment.