Re-implemented undo and sharing