HW3 finished CalcHistogramNew