getting data for  the histogram