Updated on December 7, 2016

Of all the visa programs that allow foreigners to work legally within the United States, none seems to ignite more debate than H-1B. Meant to help companies recruit workers with hard-to-find skills, critics say the program allows employers to hire thousands of cheap IT workers to replace American workers. But proponents of the program say it’s necessary to draw the best talent from around the world. Both sides want the program to undergo some drastic changes.

Foreign students are more likely to have expertise in STEM fields than Americans, and many have been in the U.S. for years, studying at American universities. The easiest path for them after graduating is to get a job offer, which would require the employer to apply for one of coveted 85,000 H-1B visas issued each year through a lottery system. What gets lost in the controversy about the H-1B visa is the fact that immigrants working in STEM fields are increasingly responsible for American innovation. These immigrants are more likely to major in science and engineering than American college students, and they file twice as many U.S. patents.

But despite rhetoric suggesting that most immigrants are a source of cheap labor, these workers, all things considered, do not come cheap. In fact, new research shows that on average, they cost employers more than American workers in the long run. A study released last week by economists at the University of California, San Diego, and Dartmouth College shows that the average foreign worker in science and technology jobs starts out making only slightly less than American-born workers—about 94 cents on the dollar. But after working in the United States for five years, the average foreign STEM worker earns $1.04 for every dollar their American colleagues make.

This salary increase could be the result of several factors. One possibility is that it comes as people acquire more work experience in the United States. Another is that after obtaining a green card, immigrants can trade up to better-paying jobs. An average of an additional 10 cents per hour after five years is a remarkable leap compared to jobs in non-STEM fields, where it takes an average of 20 years for immigrant workers to get paid the same as their American counterparts. “There’s been this heated debate about H-1B workers coming in and undercutting U.S. workers by accepting substantially lower wages, but we’re not seeing evidence to support that,” says Gordon Hanson, an economist at the University of California who is the lead author of the report.

The study analyzes Census data going back to 1980, focusing on STEM workers with at least a bachelor’s degree. Researchers controlled for salary discrepancies based on workers’ gender, race, geographic region, education, and age. It’s impossible to know exactly how many of all foreign STEM workers arrived in the United States on H-1B visas—compared to another visa program, or due to a green card obtained through family reunification. But still, the H-1B program remains the easiest way for tech companies to hire foreigners from the large pool of international students graduating from American universities, or from abroad.

The problem is that the demand is remarkably high relative to the number of visas available. Last year, employers applied for 236,000 visas, but only 85,000 were available. This high demand has led the tech industry to lobby hard for expanding the number of H-1B visas. “Why do we offer so few H-1B visas for talented specialists that the supply runs out within days of becoming available each year?” Facebook CEO Mark Zuckerberg wrote in an op-ed in The Washington Post.

Efforts to expand the program have been met with fierce resistance from many Republicans in Congress, and some Democrats, who have accused companies such as Disney and the utility company California Edison of firing in-house IT workers and replacing them with cheap contractors on H-1B visas. Last month, a federal judge in Florida dismissed a class-action lawsuit filed by former Disney employees who accused the company of visa fraud. Last year, a Department of Labor investigation found no wrongdoing in the case of an outsourcing firm that provided workers to California Edison. In both cases, the outsourcing companies benefited from a legal loophole that exempts certain employer from showing that their H-1B workers won’t take Americans’ jobs. Federal investigators also accused one outsourcing firm, Infosys, of fraudulently obtaining business-travel visas for foreign workers who should have been using H-1B visas. The Justice Department in 2013 settled a visa fraud case with the company for $34 million.

One thing both sides seem to agree on is the need to revamp the program while still allowing big tech companies to recruit the best workers they can find. Some ideas to reform the H-1B program include requiring companies to show that they could not find a qualified American worker to take a job (a requirement for other temporary work permits, such as those in agriculture). Others have suggested that visa priority be given to workers whose jobs will pay the highest salaries, to prevent companies from using the program as a source of cheap labor.

What happens to the H-1B program depends a lot on what President-elect Donald Trump thinks about the issue, and that’s been hard to decipher. During the campaign, he flip-flopped repeatedly about it. In one Republican-primary debate, he called it “very bad,” though a few days earlier Trump said he was “softening on the issue” because America needs talented people. His nominee for attorney general, Senator Jeff Sessions of Alabama, has been more consistent in his criticism. Last year, Sessions introduced legislation to make fewer visas available to large outsourcing firms, such as those based in India, which provide contract IT workers to U.S. companies. These firms get the largest number of H-1B visas through the lottery system. “Thousands of U.S. workers are being replaced by foreign labor,” Session said of the H-1B program in February, according to Reuters.

As head of the Justice Department, Sessions will likely take on visa fraud as one of his signature battles. That might help curb large-scale abuses of the system, but going too far could  keep out immigrants who help the United State compete globally. And that could undermine the United States’ role in launching the largest, most profitable tech companies in the world.