As the clock struck midnight Tuesday, long queues were seen in many Indian cities as people scrambled to withdraw money from ATMs before the cash dispensers went offline. A few hours earlier, Prime Minister Narendra Modi made a surprise announcement to the country in which he said the highest currency denominations — 1,000 and 500 rupee bills — would stop being legal tender from midnight.

But why did the Indian government take such a sudden, drastic step?

The most obvious answers were to be found in Modi’s speech, where he invoked terrorism, corruption and the shadow economy or black money as reasons for the unprecedented step.

Without naming names, Modi said: “Have you ever thought about how these terrorists get their money? Enemies from across the border run their operations using fake currency notes. This has been going on for years. Many times, those using fake five hundred and thousand rupee notes have been caught and many such notes have been seized.”

He spoke of India’s low ranking in global corruption, which despite the government’s recent efforts, has risen from 100 to 76. “The evil of corruption has been spread by certain sections of society for their selfish interest. They have ignored the poor and cornered benefits. Some people have misused their office for personal gain,” he said.

A lot of the corruption in the country is financial in nature, be it in the form of bribes for things big and small or reports of buying votes every time an election comes around. And the money for such corruption is often not declared to the tax authorities, making it black money. According to government data, about 3 percent of the country’s population files tax returns and less than 1.5 percent individuals pay taxes. According to some estimates, the shadow economy of India is worth $460 billion, roughly about 20 percent of its gross domestic product.

IndiaBankClosure A man walks out of a closed bank in Mumbai, India, Nov. 9, 2016. Photo: REUTERS/Danish Siddiqui

The decision to scrap the existing 1,000 and 500 rupee bills (worth about $15 and $7.5 respectively) tackles these issues all at once. The existing bills can be exchanged at banks and post offices (daily and weekly limits have been placed on the amount that can be exchanged) for 50 days and the new designs will thwart counterfeiters for at least some time. Banks will also accept cash deposits but doing so will automatically bring the money from the shadow into the light, so to speak.

However, the use of black money in elections is one of the biggest uses it is put to in India. In the run-up to and during the national election in 2014, almost 3 billion rupees was seized by India’s Election Commission and there are doubts about how effective the currency change will be in curbing that sort of behavior as elections in five states are coming up over the next few months.

Meanwhile, as Indians try to get more information about the new bills that will start circulating Thursday, the website of the Reserve Bank of India — the country’s central bank — crashed and had been down for several hours at the time of writing.