Implementing generalized edit.