Formation of Histogram