update algorithm to save update info to table.