Aggregate() function implemented. Exercise 2 done.