Aggregate methods: all tested and working
Fixed some bugs