Adding undo-tree