add lineAdd and lineRemove mode for edit the matrix