Now it is possible to write a custom aggregation function