add a TotalCounts function