Building data distributions using histograms