There is a big for loop that should be refactored to an outside function.
There is a big for loop that should be refactored to an outside function.