Main loop structure now in place.