update index of alg