A model of economic diversification