added swbuf and undo-redo-tree