add changes for histogramming