day two

big improvement on aggregate functions