implemented histogram