would this make more sense if it *returned* a map rather than modifying one in-place?