# CES aggregator for intermediates with heterogeneous productivity

I'm following Atkeson, Burstein (2019 JPE), and cannot understand the aggregation result.

There is measure $$M(z)$$ of firms with productivity $$z$$, with production function $$y(z) = z k(z)^\alpha l(z)^{1-\alpha}$$ Aggregate output is $$Y = \left[ \sum_z y(z)^{\frac{\rho-1}{\rho}} M(z) \right]^{\frac{\rho}{\rho-1}}$$ Assuming that markup is constant across firms and factor markets are competitive, they get the result $$Y = Z K^\alpha L^{1-\alpha}$$ where $$Z = \left[ \sum_z z^{\rho-1} M(z) \right]^{\frac{1}{\rho-1}}$$, $$K = \sum_z k(z) M(z)$$ and $$L = \sum_z l(z) M(z)$$.

I don't quite understand this jump. Following the usual steps for intermediate goods, I can derive the marginal cost and prices for each firm. They are dependent on $$z$$, so I can't simply apply the trick that all firms behave in the same way. What I do get is $$PZ = p(z) z$$ and $$y(z)=(z/Z)^\rho Y$$. Now I'm lost which way to proceed.