adding bin_edges stuff for plotting