How bags and pointers work



(arrows represent a reference. starts are what has the reference, heads are what its a reference to.  Freeform circle kinda thingies are around containers and their contents. Flopy lines represent null pointers. Notice no upwards arrows, only 1 downwards, 1 left, and 1 right out of any box. (items lower down represent being the contents of a higher up one)).