update is now in the main loop