edit algorithm