add histograms and debug prints