In light of the not passing the maps around, the rest of this code gets much simplified too.