added avg, first, last, max, min, and range aggregation functions