Actually added sharing and fixed undo