Build a histogram