example for filling histograms from loop