update algorithm related code