added the as_generator flag to get_units calls
now using content_unit_counts to calculate totals