updated aggregate method