add 2d support for aggregator and optimizer