enclosing these new classes so they don't trounce on other stuff
tiny fixes
Backing out reverse_mapping stuff
Reconstruct reverse_mapping from mapping