Wait for all grids to load before looping

Added a separate function that loops through all the grids. Hopefully
this helps with the synching between grids