ALBANY, N.Y. (AP) — New York City election officials created doubt about the integrity of the city's mayoral primary Tuesday when a failure to clear old data from a computer system led to inaccurate vote tallies in the closely watched contest.

Observers blasted the mistake as more proof of incompetence at New York City's Board of Elections, which has faced criticism in the past over other errors.

The error also had the potential to do damage to the reputation of ranked choice voting, a system the city is using for the first time this year.

Here's a look at what went wrong:

HOW DID THE ERROR HAPPEN?

Voting in New York City's mayoral primary ended June 22. Tuesday was supposed to be the first time officials released results based on the ranked choice voting system, which allows people to rank up to five candidates in order of preference.

Under the system, ballot data is fed into a computer program, which tallies the votes and shows where the candidates stand.

Somehow, though, elections officials had failed to clear the computer of 135,000 test ballots that had been loaded in earlier to make sure the system worked.

When the votes were tabulated, those 135,000 ballots were mixed in with more than 800,000 real ones, corrupting the results.

The board realized the error and took down the data, but not for several hours. In the meantime, the news media had been reporting on the flawed numbers, which appeared to show Brooklyn Borough President Eric Adams losing much of his lead in the race.

WHAT DOES THIS ERROR HAVE TO DO WITH RANKED CHOICE VOTING?

Not much, actually, except that it was a new system with which the city has had little experience in reporting results.

Under the system, a candidate who is the first choice of a majority of voters is declared the winner.

But if there’s no majority, voters' rankings of other candidates are taken into account. Vote tallying takes place in rounds. In each round, the candidate in last place is eliminated. Ballots cast for that person are then redistributed to the surviving candidates, based on voter rankings.

The process repeats until only two candidates are left.

If elections officials had reset the counting system properly before loading in the ballot data, the ranked choice analysis performed Tuesday should theoretically have worked just fine.

WHAT IS BEING DONE TO FIX THE PROBLEM?

The Board of Elections said Tuesday that its staff has removed all the test ballot images from the system, that it will again upload election results and that it will cross reference election night reporting software to verify the preliminary results.

“The cast vote record will be re-generated and the RCV rounds will be retabulated,” the board said in its statement.

The new report was expected to be released Wednesday afternoon.

WILL THIS EFFECT THE ACCURACY OF THE FINAL RESULT?

It shouldn't now that the corrupted data has been erased from the system.

New Yorkers are still far off from knowing the final result in the Democratic primary because at least 125,000 absentee ballots have yet to be included in the city's vote count.

The process of counting votes sent by mail only began this week.

It remains to be seen whether the board's error itself will make the public less likely to trust final results.

IS THIS GOING TO AFFECT WHETHER OTHER JURISDICTIONS ADOPT RANKED CHOICE VOTING?

Though the error was related to poor management of a computer system, it is possible it will scare people away from ranked choice voting.

Critics have long argued that the system can confuse the public. In Maine, the state's use of ranked choice voting in 2018 led to litigation.

But voters upheld the system in referendums, and the state rolled out the system without chaos.

A federal judge who tossed former GOP U.S. Rep. Bruce Poliquin's lawsuit challenging the results of his election loss said he wasn't “persuaded that it is unduly burdensome for voters to educate themselves about the candidates in order to determine the best way to rank their preferences.”

Copyright 2021 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed without permission.