aggregate using a map, not a list