Added range to aggregation functions