do_histograms script