test update and pulling main loop out of run