adding support for undo

to come: multiple redo