Made histograms work.

This required adding everything we need to calculate all of
the other quantities.