Matching Dataset to Histogram