Added update function.