aggregation

Implementing generic aggregation.