deleting and undo stack work