move all the addAggregate work into the final pass, general cleanup