The economics of school choice and sorting