more generic TotalCounts impl