update  dynamic alg