Adding routine to call an arbitrary function of the elements that fall on each bin of a histogram.