Solving the resources curse