Refactors the syntax of the for loop to use much range