My implementation of aggregate !!!!