Add aggregate() functionality