coding #3 adding the function definitions of the histogram