implement total() for histogram