modified to use histogram plotter