edit algorithm prev commit