Rework aggregate functions and provide examples