added undo and history levels