Sample of how you would develop a run loop using select