implemented histogram estimator