Added aggregate
Fixed bugs