new update algorithm