The world’s biggest democracy has more than its fair share of problems, but getting out the vote isn’t one.

Despite India’s high illiteracy rate, and the lack of decent roads and home addresses, voter turnout in its last elections (in 2014) was 66%—higher than in many richer, more developed countries. Rates are expected to hover around those levels again in April during India’s upcoming general election, dubbed “the festival of democracy.”

This is the result of the Indian government’s determination to reach every single voter, no matter the practical challenges. Whether at the top of the Himalayas or in the middle of a forest, it ensures no one has to travel over 2 km (about 1.2 miles) to get to the polls. It even has a budget for elephants to carry machines to hard-to-reach areas.

Reuters/Utpal Baruah Polls are set all over the country, no matter how remote the location.

SY Quraishi, who was India’s highest election official between 2010 and 2012, calls the massive endeavor “an undocumented wonder” in his 2014 book about running the world’s largest election—that’s actually its title. “I mean to diminish no individual, institution, or phase in our history when I say that India is valued the world over for a great many things, but for three over all others: The Taj Mahal, Mahatma Gandhi, India’s electoral democracy,” he writes.

To be sure, the Indian election is a thing of wonder. Its scale alone is mind-boggling: More than a million polling stations, 900 million voters, nearly 2,300 parties.

It is also an impressive work of democratic logistics that can teach a few lessons to the rest of the world, including countries with far more resources, like the US.

No voter left behind

“India is to be found not in its few cities, but in its 700,000 villages,” Gandhi famously said of his country. That statement still rings true when it comes to voting. There are over 640,000 villages in India, and the election commission, the non-partisan body in charge of the election, has the daunting constitutional mandate of reaching them all. So it set up an ingenious, thorough system to do so—one that’s so on top of voter affairs, that the world’s biggest election can be prepared in a month.

“India is valued the world over for a great many things, but for three over all others: The Taj Mahal, Mahatma Gandhi, India’s electoral democracy.”

On Mar. 10, India announced the dates of the country’s general election across its 29 states. The first votes will be cast on Apr. 11, and the election will continue in seven stages till the last polling date, on May 19. All votes, which will elect 543 members of the Lok Sabha, the lower house of the parliament, will be counted on May 23.

Ashok Lavasa, one of the two election commissioners, who, with the chief election commissioner, run India’s Election Commission, says the key to pulling it off is focusing on two goals: “To keep the electoral roll updated, and to conduct elections whenever they are due.” This would be a large task in most countries. In India, it’s a gargantuan one, as it means making sure over 900 million voters—by far the largest electorate in the world—are ready to cast their ballots.

To get it done, the commission has set up a multi-layered system of over a million people that connects its national leadership in Delhi to all voters, no matter how remote their location. From the Delhi headquarters, the registration work is shared with the country’s 29 states and then with the nearly 700 districts within those states. Finally, the last mile—or rather, the last 2 km—is taken on by booth-level officers, one for each of the 1.035 million polling stations.

According to the Indian constitution, all citizens above 18 have a right to vote. Voter registration is an ongoing, proactive effort undertaken by the Election Commission, which has a mandate of reaching all the eligible voters at the right location, and providing them with voter IDs.

The commission uses a combination of community-based personal outreach, determination and clever solutions. For example, to make up for high illiteracy rates, booth-level officers—each typically responsible for about 1,000 voters—explain in person how the elections work and their importance. They even direct voters to their polling station location. Voter ID cards are delivered in person too, because many voters lack home addresses, and it’s hard to track whether mailed information has been received. The commission also delivers all other elections-related notices in person.

The commission has set up a multi-layered system of over a million people that connects its national leadership in Delhi to all voters, no matter how remote their location.

On average, there are between 900 and 1,000 voters assigned to each polling booth, though occasionally, in remote or sparsely populated areas, the number can be just a handful or even one. In cities, the maximum per booth is 1,400, while in rural areas it’s 1,200. Lavasa explains that it’s a group small enough for booth officers to keep track of, while also allowing them to be known by the community they serve.

This is a far cry from what happens in a country like the US, where the onus of knowing election rules is on the citizen—to the point that people can go to jail for years for mistakenly trying to vote without having the right. The results speak for themselves: India’s turnout is higher than in much richer countries, and nearly 12% higher than in the US.

A day at the polls

Even on election day, voter convenience and simplicity are paramount to the commission, as is avoiding fraud in a country that is notoriously rigged with corruption and scams.

Setting up the polls and conducting the vote requires an even larger group of people: Around four to five million between presiding officers (one per polling station) and polling officers. Stations usually stay open for eight to nine hours, and voters can present one of 12 pieces of ID, including the EPIC, an electoral photo ID card, to be checked against the voter roll.

To avoid double voting, once a person has been checked off the list, an indelible ink mark is put on the voter’s finger. Lavasa told Quartz that the mark (which remains for three months) has to be made on a prescribed position—half on the finger and half on the nail, on a specific finger—making it nearly impossible for someone who has already voted to remove it to vote again. It might seem like a rather rudimentary solution, yet it’s low-cost and effective in avoiding confusion and accusations of fraud.

Reuters/Rupak De Chowdhuri No double voting.

The US, for instance, doesn’t really have a similar system to prevent double voting, particularly for people who have moved across state lines. Electoral rolls are not checked at the federal level, and there is no mark to identify someone who has already voted.

Though Indian voters also cast their ballots on electronic voting machines, they are much simpler and arguably more reliable than the ones used by their American counterparts. Unlike the machines in America, which are manufactured by private companies, differ in each state, and need proprietary ballot paper, the ones used in India are made by two government firms, and are battery operated—a key detail in a country that struggles with power supply. (Plug-in machines caused problems in the latest US election, as some workers forgot to plug them in). Each machine holds up to 2,000 votes, so large-scale hacking is highly unlikely.

Voters press a button corresponding to their choice, and a sound confirms that the vote has been cast. There is an audit paper that gets printed, reflecting the vote, that the voter can see through a small window in order to check that there were no irregularities in the registration.

At the end of the voting day, all the machines, together with the paper trail, get sealed and stored in a strongroom.

Guarded votes

The month-long span of the election presents yet another obstacle for the government: What to do with the ballots already cast while the election is still ongoing? All the counting happens at the same time, so results from one area don’t influence voting in another. There, too, the solution is pretty straightforward: placing guards outside the strongrooms to make sure no one handles the ballots until it’s time to count them.

Reuters/Amit Dave Checking on voting machines.

Representatives of the candidates can join the guards in keeping watch. CCTV cameras also add to the surveillance. Their footage is displayed on an outside screen, visible to citizens at any time.

The counting process, too, is designed for maximum accountability. The machines are brought to the counting hall and inspected by the candidates, or their representatives. They are then distributed on several counting tables—usually between 14 and 21, depending on the size of the polling station—where they are opened. All the votes are counted, tabulated, and announced. The counting is redone until all candidates, representatives, and electoral delegates are satisfied with the accuracy of the results. The goal, explains Lavasa, is to complete the task in the fastest possible way, though sometimes there can be up to 20 rounds of counting. Overall, the counting process usually takes less than a day.

Overall, the counting process usually takes less than a day.

By way of comparison, the US takes four weeks or longer to count a much smaller number of votes.

Once the results are announced and registered, the machines are once again sealed, and returned to the strongroom where they remain for 45 days, in case votes need to be recounted due to a dispute. Occasionally, results are challenged, particularly when the margin of victory is small. Yet India has managed to stay away from large-scale contested results, like those seen in recent US history.

On May 23, with the counting done, the election apparatus will have completed its task: The greatest election in human history will be over, and the world’s largest democracy will have chosen its parliamentary representation for the next five years.

And all this, at quite the bargain: The election commission’s budget for the past general election was rupees 34 billion, or about $500 million, elephants included. By comparison, the US spends several times more, with an estimated cost of $2.6 billion, for less than a third of the population.

Correction: The article previously misstated the cost of the Indian election. It is, in fact, Rs. 34 billion.

Read Quartz’s coverage of the 2019 Indian general election here.