Every two years, America drags old, expensive, proprietary machines out of storage to perform the single most important technological task in a Democracy: count votes. And without fail, these machines break down in some districts, causing obscene waits and generally undermining faith in the democracy.

This year’s election follows that general trend: Voters in South Carolina are reporting machines that switched their votes after they’d inputted them, scanners are rejecting paper ballots in Missouri, and busted machines are causing long lines in Indiana. The issue is particularly bad in New York City, where several people told Motherboard they stood in line for four hours before voting because machines that scan paper ballots weren’t working at many polling sites.

One of the big problems is that there are very few people who are able to actually fix the machines, because they are proprietary, and some of the vendors that originally made them have gone out of business.

“The voting machines purchased after the 2000 election are literally falling apart in jurisdictions in almost every state, many of which no longer have the funds necessary to purchase new ones,” a 2016 study by Penn Wharton business school begins. That study, called The Business of Voting, found that the voting machine industry isn’t very competitive, isn’t very lucrative, and suffers from years of stagnation and lack of investment. “The election technology industry, as it exists today, has all the aspects of an industry that new investors would want to avoid—a costly regulatory environment, constrained market size, cost-conscious customers, and concentrated and entrenched vendors.”

Because voting machine schematics and repair manuals are proprietary and closely held, few people know how to fix them, and when companies stop supporting their machines or go out of business, state election officials have been forced to find replacement parts on eBay.

Regardless of how many people are in line at a polling site and how many machines there are, New York poll workers are instructed to scan paper ballots into the machines that are working at that moment. Poll site workers are only allowed to use “emergency ballot procedures”—where paper ballots are placed into a bin and counted by hand later—if all machines at the precinct are broken. This means that a polling site could have been set up with five scanning machines at the beginning of the day, but if four of them are broken, every single voter must use the single machine that still works: “If all scanners have broken down and emergency ballot procedures used, the ballots are considered emergency ballots,” a poll workers handbook reads.

This is what happened at St. Cecilia’s Church in Greenpoint, Brooklyn, where several of the machines were broken—but one was still working—resulting in extremely long times.

“People weren't bothering with the [privacy] booths and just went straight to the scan line” where they could put their ballot in the working machine, one voter told Motherboard in an online chat. Motherboard is not naming the voter because their employer did not give them permission to speak to press. “The scan line wrapped around the gym in a way that makes the worst airport I've ever been in make sense. After an hour they started pulling the elderly and pregnant to get them to vote first...at that point there were 3 machines working. Then those machines stopped working and they were down to one machine for about 100 people ahead of me. Eventually [poll workers were] just shoving the ballots into the broken machine's slots at the front.”

One voter at that precinct sketched a picture of the long voting line to keep busy while she waited.

“In Queensbridge, the largest public housing project in the country, there’s only one voting site and just four scanners,” journalist Max Rivlin-Nadler tweeted. “Right now, one is not working and the ADA accessible one is also broken.”

Voting machines are legacy equipment. They’re not complicated, but they aren’t common. Repairing them isn’t something techs often have to tackle. They’re also only used a few days out of the year, so a system-wide breakdown of the machines overworks repair techs and causes horrible delays in voting.

Another problem is that poll workers often don’t know what to do when the machines break down. According to NYC law, there are procedures in place to hand count ballots when the machines go down. Not every single ballot needs to be scanned by machines.

The New York City Board of Elections did not immediately return our request for comment.