Green Party presidential candidate Jill Stein. (Mark Lennihan/Associated Press)

Jonathan S. Abady and Ilann M. Maazel are partners in the New York law firm Emery Celli Brinckerhoff & Abady and are lead counsel for Green Party presidential candidate Jill Stein’s recount effort.

As lead counsel in Green Party presidential nominee Jill Stein’s quest to have votes recounted in Michigan, Wisconsin and Pennsylvania, we have been in court for the past two weeks trying to verify the integrity of the election and make sure that no one hacked our democracy. Some have cast Stein as a spoiler, or alleged that the recounts were futile because they didn’t change who won the election.

But the recount would be futile only if we, as Americans, ignored the lessons of the past weeks and preserved the status quo that is our broken voting system.

To start, we must recognize that what we saw in Michigan, Wisconsin and Pennsylvania were recounts in name only. Though more than 161,000 people across the nation donated to the effort — and millions more demanded it with their voices — every imaginable financial, legal and political obstacle was thrown in the way of the recounts.

In Michigan, a state court shut down the recount after only three days. In Wisconsin, instead of hand-counting all paper ballots — the “gold standard” of election auditing — many ballots were fed into the same electronic machines used on Election Day, producing the same potentially faulty results.

In Pennsylvania, the state’s labyrinthine election system erected insurmountable barriers to even beginning a recount, requiring 27,474 voters in 9,158 districts to bring notarized petitions to county election boards, in time for shifting, divergent and secret deadlines. One court demanded that the 100-plus voters who petitioned for a recount post a $1 million bond to move forward with their case.

In an election tarnished by unreliable, insecure and unverifiable voting machines, ordinary Americans should at least be able to make sure their votes are counted, especially in states with razor-thin margins.

Beyond the obstacles to the recounts themselves were the irregularities and anomalies we uncovered while counting. The recounts did not confirm the integrity or security of our voting system; they revealed its vulnerability.

In Wayne County alone, 128 out of 534 precincts checked during the recount had discrepancies between the number of names listed in the precinct’s poll book and the number of ballots in the ballot box, among other errors. Eighty-seven optical scanners broke in the Democratic stronghold on Election Day, causing erroneous vote counts. And in Milwaukee County, officials refused to hand-recount ballots.

The location of these failures is no coincidence. Underserved communities and voters of color are much more likely to have their votes misread or tossed out by human error or badly maintained and poorly calibrated machines.

Pennsylvania has the worst voting system of all. The vast majority of voters use machines with no paper ballot to verify the vote. According to leading computer scientists, these direct recording electronic machines, or DREs, are unreliable, antiquated and easy to hack.

The machines claim, for example, that more than 4,000 voters in Montgomery County , Pa., took the trouble to go to the polls, then supposedly voted for no one in any election. In reality, when these voters in Montgomery selected candidates on the machine, a “no vote” box popped up, meaning thousands of votes were lost inside those machines.

During the course of our representation, we consulted some of the world’s leading experts in computer science and cybersecurity. They all agreed on two fundamental points: First, much of our voting machinery is antiquated, faulty and highly vulnerable to breach; second, it would be irresponsible not to verify the accuracy of the vote to the greatest extent possible.

Such verification would have required a full, high-quality recount of paper ballots in Wisconsin and Michigan and a forensic examination of DRE voting systems in Pennsylvania to determine whether the results are accurate.

Ultimately, we must modernize our system of voting and reform our laws governing elections.

That means automatic audits after Election Day in every county in the country to spot unusual results and to cross-check the tallies produced by the optical scanners that count the ballots. It means ending the use of touch-screen voting machines, replacing them with hand-marked paper ballots and having automatic recounts when races are very close.

It means removing the many obstacles constructed to block recounts in the first place, updating decades-old voting machines and taking swift action to secure our electoral system against threats posed by hacking.

The campaign to verify the vote should be nonpartisan. Stein has done the nation a real service in demanding these recounts. By refusing to surrender in the face of significant resistance and criticism, she has exposed problems in our voting system and shown a way forward for reforms that will protect our democracy in a new age of vulnerability.

On Monday, Americans will know with certainty which candidate the electoral college has chosen for president. But we cannot know with equal certainty for whom the American people voted. If there is a lesson from the recounts, let it be that we never make that mistake again.