Refactor for loops again to not initialize 2 variables.