again lots of code always ripe for a few comments. Just briefly - why this loop, what is being aggregated.