Added principal aggregation to provide a generic solution for groups
etc.