Switched to the for loop as it's easiest to read in this circumstance