How borders are drawn and enforced has far-reaching consequences, whether we live on either side of them or halfway across the world.

The promise to deport millions of undocumented immigrants was a staple of Donald Trump’s presidential campaign. He launched his bid vowing to build an “impenetrable, physical, tall, powerful, beautiful, southern border wall” along the US-Mexico border” and turn of the “jobs and benefits magnet.”

After winning the election, Trump doubled down on his hardline immigration policy. But two research professors suggest a radically different approach—amnesty.

“Legalizing them [undocumented workers] would lead to an increase in GDP,” says Francesc Ortega, an economist at Queens College in the City University of New York (CUNY). In a recent working paper, Ortega and Ryan Edwards, another CUNY economist, estimated that undocumented workers contribute 3% of the US’s private-sector GDP annually, or close to $5 trillion over a 10-year period.

That figure masks differences across industries and states. In California, for example, undocumented workers contribute around 7% of private-sector GDP in the state. In industries where a lot of workers are undocumented, such as agriculture, construction, and leisure and hospitality, they may be responsible for 8%-9% of the value-added.

Researchers describe these figures, which is based on a model they calibrated using a combination of aggregate and individual level data, as “substantial.” But they also found something telling: though undocumented workers contributed significantly to the US economy, they were about 25% less productive than documented foreign-born workers.

The study suggests this is because they’re job options are limited—certain jobs require a license, or are more stringent in checking identification and legal status—and so they earn less than their documented counterparts. This so-called “productivity penalty” could be overcome in part through legalization.

This isn’t entirely new terrain for the US. In 1986, Ronald Reagan gave amnesty to nearly 3 million undocumented immigrants. This, according to Ortega, boosted the economy, because “legalization increased those workers productivity and income by opening new labor market opportunities.” There’s evidence some evidence that shows undocumented workers went on to get better jobs and higher wages in the years after legalization. A previous study suggests there was a 15% increase in productivity after legalization in 1986, followed by another 10% to 12% increase in productivity when migrants became citizens.

In fact, the CUNY study’s second main finding is that providing amnesty to undocumented workers now would increase their economic contribution by 20%—equivalent, in the US’s case, to an extra 0.6% of GDP.

“There’s also been some studies done legally on immigrants from El Salvador who have temporary legal status in the US, known as temporary protective status,” says Randy Capps, the director of research for US programs at Migration Policy Institute. “These temporary workers earned more than those that were undocumented.”

Capps points out the obvious drawback to granting amnesty to millions of undocumented migrants: “You’d definitely be providing an incentive for more people to come.”

While amnesty is out of the question under a Trump administration, Capps suggests mass deportations will also be difficult. Trump would not only have to find undocumented immigrants—many of whom live in so-called sanctuary cities (paywall), which protect them by not cooperating fully with federal immigration authorities—process them in overstretched immigration courts, and attempt to hold people in overcrowded detention centers.

“If you really want to ramp up deportations, you’ll have to pay for more immigration judges, immigration officers, detention space, and convince these big cities to participate. They’ll be a lot of political and financial costs,” Capps explains. “But, any legalization will be paid for by fees from immigrants.”