small modification to histogram plotting code