sloppy factoring of histogram method