expand matrix after aggregation