Added update function
Added update function.