changed find_dist_histogram to use existing code