Added variable to allow different numbers of aggregated instances