commit finshed alorithm