renamed 'update' function