Add a working update loop