can you put in how one would use map_reduce to do this? i actually had the suspicion that it did what i wanted but it's sort of scary to read