change in getHistogram function
compute the histograms for all the labels
histograms of all labels