added agg functions to index