update algorithm