fixed broken tests and created aggregateCount mthd