I had to tweak a few things for the histogramming to work properly and did little housekeeping.  I removed some unecessary imports.