added the table and undo/redo functionality