While we cannot accept the racism and misogyny on which Donald Trump’s electoral victory fed, we must recognize that the white working-class voters who largely supported him have real grievances. They have been economic losers over the last four decades. They have seen their wages stagnate, and their kids face bleak labor-market prospects. Their plight resulted from economic policies that were designed to redistribute income upward. Globalization was the most visible of these policies.

Among the many myths about globalization, the worst is that the loss of large numbers of manufacturing jobs in the United States (and Europe) was inevitable. Because the developing world is full of low-paid workers, this argument goes, it was impossible for Americans to compete. Economists and politicians promoting this view might consider the outcome unfortunate for U.S. workers, but also unavoidable. They take comfort in the growing living standards of billions of impoverished people in the developing world.

This is a palatable view of the history of the last forty years for those who were not its victims, but it is wrong in just about every way.

Globalization need not have taken the course it did. There was nothing inevitable about large U.S. trade deficits, which peaked at almost 6 percent of GDP in 2005 and 2006 (roughly $1.1 trillion annually in today’s economy). And there was nothing inevitable about the patterns of trade that resulted in such an imbalance. Policy decisions—not God, nature, or the invisible hand—exposed American manufacturing workers to direct competition with low-paid workers in the developing world. Policymakers could have exposed more highly paid workers such as doctors and lawyers to this same competition, but a bipartisan congressional consensus, and presidents of both parties, instead chose to keep them largely protected.

The first assumption about globalization—that the United States must have a large net inflow of goods—is easily refuted. We did not have to run large trade deficits with the developing world in order to reap the advantages of trade. Nor were trade deficits a necessary condition for improving the lot of the world’s poor.

The worst myth about globalization is that the loss of manufacturing jobs was inevitable.

Indeed, economic theory suggests the opposite. Developing countries are supposed to run trade deficits with rich countries. In rich countries, capital is relatively plentiful, so it earns a low rate of return. In poor countries, by contrast, capital is relatively scarce, so it earns a high rate of return. The textbook story implies that investors in the United States would do well to lend money to developing countries to help finance their growth.

The flow of capital from rich countries could finance a trade deficit on the part of developing countries. This would allow them to improve living standards by importing consumption goods even as they build infrastructure and capital stocks. In standard economics the problem for developing countries is scarcity of goods and services. They thus benefit from being able to buy more than they sell.

Yet many “experts” instead argue that the main problem of the developing world lies in finding someone to buy its stuff. This wrongheaded perspective betrays the corruption of our policy debates. These observers flip standard economics on its head by suggesting that the chief economic problem facing the developing world is a lack of demand for their goods and services.

Some may view the textbook model as merely hypothetical. It is not. In East Asia in the 1990s, until the financial crisis in 1997, countries were growing rapidly even as they ran large trade deficits. While growth and reduced poverty in the region have been touted as the benefit offsetting the pain of the working class in the United States and other wealthy countries, East Asian states actually grew faster in years when they ran trade deficits. In fact, if the countries of East Asia had maintained their pre-crisis growth rate, two of them, Malaysia and South Korea, would now be richer on a per capita basis than the United States. While imbalances were developing during the run-up to the crisis, and some of the region’s trade deficits were probably too large, there is no reason that a pattern of growth relying on foreign investment could not have been sustained.

The conditions of the 1997 bailout, which was engineered by the Clinton administration through the International Monetary Fund, turned the developing countries of the region into net lenders of capital, reversing the direction of capital flows from the pre-crisis period. This was a conscious policy choice with disastrous consequences for large segments of the U.S. workforce. The bailout could have included substantial debt forgiveness, which would have allowed the East Asian countries to continue borrowing to finance their development. But the Clinton administration insisted on full repayment of debt, protecting banks and other lenders from their mistakes and forcing these countries to massively increase their exports in order to pay what they owed.

It is not just the volume and direction of trade flows that reflect policy choices. A second assumption in the familiar story about globalization concerns the content of those flows. Trade deals negotiated by administrations of both parties have been designed to enable U.S. corporations to manufacture goods in developing countries and return the output to the United States with minimal restrictions. This choice puts U.S. manufacturing workers in direct competition with low-paid workers in the developing world. Our economy may gain as a whole from access to low-cost goods made in the developing world, but a predictable and actual outcome of this pattern of trade is the loss of U.S. manufacturing jobs and downward pressure on the wages of less-educated workers generally.

There were other options, and there still are. Just as we can save money on shoes and shirts by buying goods made in China, we could save on our medical bills and legal services if we allowed low-paid doctors, lawyers, and other professionals from developing countries to practice in the United States.

As it stands, almost nothing has been done in this era of trade liberalization to reduce the barriers protecting our most highly paid professionals. It is illegal for a doctor to practice medicine in the United States unless she has completed a U.S. or Canadian residency program. (The number of slots in these programs is strictly limited, with a small fraction open to foreign-trained doctors.) Dentists are prohibited from practicing in the United States unless they graduate from an American dental school; the lone exceptions among foreign nationals are graduates of Canadian dental schools.

It is absurd to believe that the only way to be a competent doctor is to complete a U.S. residency program. If we applied our free-trade principles to medical and dental services, as well as to the work of other highly paid professionals, we would establish an international system of credentialing that would allow foreign professionals to train to our standards and practice in the United States. This is not some absurd fantasy. Able workers in these fields already collaborate all over the world; the bones and teeth and hearts in India are no different from those of Americans.

In this era of trade liberalization, almost nothing has been done to reduce the barriers protecting our most highly paid professionals.

The potential gains from freer trade in these services are enormous. The average physician in the United States earns more than $207,000 a year, more than twice the average in several other wealthy countries. If we paid our physicians the same amount as those in Germany, Canada, and elsewhere, we would save close to $100 billion a year, or almost $700 for every American family. If we opened up other highly paid professions to international competition, the gains would be even larger. Some people will complain that such a program would hurt the world’s poor by drawing the best and brightest from elsewhere to the United States. But this “brain drain” can be offset by taxing the income of foreign professionals and repatriating it to their home countries, which could use that money to train two or three professionals for every one lost to the United States. This is the sort of compensation system for losers from trade that proponents of trade deals always tout as ensuring widely shared benefits. In the U.S. case, the compensatory programs have always been quite limited.

In generating savings from freer trade in the labor of doctors and lawyers and so on, we would also be promoting equality, since these professionals sit at the top end of the income distribution. It is important to remember that the income of highly paid professionals is a cost to everyone else. If we can get their services for less, living standards for the rest of the population increase. Rejecting this route is a form of protectionism that benefits comparatively wealthy American professionals.

Other kinds of protectionism, too, are costly for Americans. For instance, a major thrust of recent trade deals has been stronger and longer patent and copyright protection, with a focus on preserving prescription-drug monopolies.

Increasing the strength and length of patents and other forms of protection became a central aim of trade policy beginning in the Clinton administration. The White House inserted the Trade Related Aspects of Intellectual Property Rights (TRIPS) provisions into the negotiations at the Uruguay Round of the General Agreement on Tariffs and Trade (subsequently the World Trade Organization) just as they were being completed. Every subsequent trade agreement has further extended intellectual property rights. These IP provisions typically raise the cost of protected items by several thousand percent above the free-market price. This is especially problematic in the case of prescription drugs, since people’s lives and health are at stake.

With few exceptions, drugs are cheap to manufacture. This means that, in the absence of patent and related protections, they usually wouldn’t cost much to buy. The Hepatitis C drug Sovaldi provides an excellent example. Three months’ worth of a high-quality generic version sells in India for $900. The list price in the United States is $84,000. This is equivalent to a tariff of more than 40,000 percent.

This huge gap between the patent-protected and free-market prices encourages abuse and corruption, just as economic theory predicts. Companies have enormous incentive to push their drugs as widely as possible. They also have incentive to conceal evidence that their drug is less effective than claimed or that it could even be harmful. It is rare that a month goes by when we don’t see a scandal of this nature in the prescription-drug industry.

The purported benefits of long and strong patent protections for prescription drugs are overblown. For example, the notion that we get better drugs this way, because patent protections pay for the high cost of research, is mistaken. Alternative mechanisms would almost certainly be more efficient. The government could pay for the research upfront and place all findings in the public domain. It already spends $32 billion per year funding biomedical research through the National Institutes of Health. This funding could be doubled or tripled to pay for development and testing of new drugs and easily be recouped with the savings accrued from free-market drug prices. The United States spent more than $430 billion on prescription drugs in 2016. More than 80 percent of that cost would be saved in the absence of patents and related protections.

The insistence on stronger and longer patent and copyright protections not only imposes economic costs on Americans and on our trading partners but also further weakens the position of manufacturing workers in the United States. The basic story is straightforward. If our trading partners are paying Pfizer, Merck, and Microsoft more, then they have less money with which to buy goods manufactured in the United States. In effect, a larger inflow of money for intellectual property implies a larger trade deficit in manufactured goods. This is not free trade. It is picking winners and losers, and it is bad news for the bulk of the U.S. workforce.

In short, almost everything about the story of globalization as a natural or necessary process is false. The United States does not need to run a trade deficit, large or small, with the developing world. And these trade deficits are not prerequisites for reducing poverty there.

If globalization in the current mode was not preordained, it was also not an accident. The exposure of American manufacturing workers to competition with low-paid foreign workers follows policy choices made by officials who knew their decisions would result in lower pay for Americans.

Ending protectionism for highly paid professionals and intellectual property would help to reverse the past four decades of upward income redistribution, but it will not be enough on its own. It is also necessary to attack the bloated financial sector and its excessive paychecks, fix a broken corporate-governance structure that allows CEOs outlandish salaries, and rethink macroeconomic policy that has sacrificed employment on the alter of low inflation. I address these issues more thoroughly in my new book, Rigged.

I chose that title advisedly, and it applies as much to globalization as it does to these other areas of concern. For if the purpose of globalization was to redistribute income to wealthy Americans, then the process we have seen in recent decades makes perfect sense. But if the goal was to promote economic justice or maximize growth, then globalization should have taken a different path.

As a practical matter, trade policy is largely dominated by the interest groups that stand to benefit directly, such as manufacturers seeking cheaper labor in the developing world. They got their way largely by wrapping their agenda in the ideology of free trade, which most educated people—including politicians, economists, and journalists—believe they must support. For some of these people, promoting so-called free trade has been a cynical exercise. But most educated Americans supported this path of globalization because they could believe that it was actually benefitting people in the developing world and, in any case, was dictated by the laws of economics. These more educated workers were largely among the winners from this policy course.

But we can design paths of globalization that benefit the developing world at least as much as the present one, while preventing upward redistribution in the United States and other wealthy countries. The question is whether educated voters will ignore reality and continue to blindly support current policy or whether they will be open to a more inclusive path for trade and globalization.

Editor’s Note: This essay is adapted from the book Rigged: How Globalization and the Rules of the Modern Economy Were Structured to Make the Rich Richer.