Set up for loop for onLoad function