refine histogram computing