rewrite Histogram's .sample in an iterative style
Merge branch 'refactor.histogram-sample'