adding aggregates.R