small changes to histogram analysis