loop files and plot histograms