Adding the loop to do multiple runs, a work in progress so it needs more thought and work but runs for now.