Aggregate function first version
aggregate function to be tested