streamlined CalculateHistogram class