adding changes from aggregation branch