changed to sorting on _id instead of timestamp
added aggregate query logging