update function

update function finalized