update sync algorithm