Cleaning up the for loop