A Theory of Wage Dispersion and Job Market Segmentation