New update function