var keyword added on for loops to avoid issues