adding function for histogram