Fixed the problems with histogramming! Now all that's left (hopefully) is to get output going.