basic undo/redo support in LM class