Improve the histogram-func