cmap implementation of map with multiple keys to one value and helper functions to work with the data structure