done implementation of histogram