updating the histogram