implement and test aggregates