For a while there, Detroit’s income tax might as well have been optional.

About 400,000 people—residents and anyone working inside the city limits—are required to file a tax return to Detroit. Almost half of them weren’t doing so. Perhaps that explains, in part, why the city filed for bankruptcy four years ago.

Detroit “sent out thousands of letters to people,” said Debra Pospiech, the city’s deputy treasurer for tax. “People just threw them out.”

Getting people to pay taxes is a problem everywhere, of course, but Detroit had a particularly hard time going after scofflaws because budget cuts decimated its ability to enforce the law. Even the people who paid up created logistical havoc for beleaguered city bureaucrats. In Detroit, the only way to file taxes was on paper. An irritation for taxpayers turned into a nightmare for city workers, who spent hours typing data into computer systems.

Detroit’s tax trouble became the basis of an economic experiment last year. The city decided to send out more than 7,000 mailings to deadbeat tax filers, people whose 2014 tax returns were already a year late. The city suspected each delinquent owed at least $350. Taxpayers were randomly selected to receive one of six different letters, each with a different message in a black box on the mailing.

One message appealed to residents’ civic pride, as the city tried to bounce back from its bankruptcy: “Detroit’s rising is at hand. The collection of taxes is essential to our success.”

Another simply made clear that the city’s tax collectors had detailed information on the deadbeats: “Our records indicate you had a federal income of $X for tax year 2014.” Detroit residents owe 2.4 percent of their incomes to the city, after a $600 exemption. Nonresidents who work in Detroit pay a rate of 1.2 percent.

And one message made a bold declaration: “Failure to file a tax return is a misdemeanor punishable by a fine of $500 and 90 days in jail.”

It turned out that the threat worked best. More than 10 percent of taxpayers responded to the letter mentioning a fine and jail time, more than three times the response rate of a basic control letter.

Ben Meiselman, a graduate student at the University of Michigan’s economics department, took a desk in the city tax office to run the experiment. He wrote the messages included in the mailings to reflect behavioral economics research. “I find that a single sentence, strategically placed in mailings to attract attention, can have an economically meaningful impact on tax filing behavior,” Meiselman wrote in a working paper that will eventually become a chapter in his doctoral dissertation.

Giving details of a taxpayer’s income boosted the response rate by 63 percent. But a letter that combined a threat with income information was less effective than a threat by itself. “Keeping it simple seems to be the key,” Pospiech said. Appeals to civic pride fell flat, with a response rate just 0.8 percentage points higher than that of a basic letter.

Detroit still has a long way to go, even if it manages to apply the results of the experiment and triple the response rate from tax delinquents. About 6 percent of U.S. taxpayers break the law by not filing with the Internal Revenue Service each year, according to research by economic consultant Brian Erard. In Detroit, Meiselman estimated, 46 percent of taxpayers hadn’t submitted their 2014 returns by the due date in the following year—and things were getting worse.

Detroit’s next step was to back up threats with action. No matter what letters from the city suggest, taxpayers could maintain a sense of impunity. The city hadn’t undertaken an audit or tax investigation in more than a decade. The city tax office, which once had a staff of about 70, was down to fewer than three dozen employees who spent all their time processing paper returns.

The department recently reorganized—last year the state of Michigan took over collecting and processing Detroit’s current-year returns—to free up city employees to collect unpaid taxes. Detroit also allowed taxpayers to file electronically for the first time, and 77 percent of filers took advantage. The city has sent out 15,000 letters since July 2016 and has collected $5.3 million through letters, audits, and investigations. Some of the amounts collected are significant, particularly for those who have dodged taxes for years. In one case, a taxpayer agreed to pay $400,000.

Detroit also started filing misdemeanor charges and lawsuits in small claims court to get its tax money. Officials noticed that only one in five residents in several high-end apartments buildings had filed income taxes. The city persuaded a judge to issue an order requiring landlords to turn over tenant information.

So far the more aggressive approach seems to be working. The number of residents filing returns more than doubled last year from the previous year. Filing by nonresidents rose 37 percent. It’s too early to tell how seriously taxpayers are taking their filing obligations this year. City returns from 2016 are due, along with state and federal returns, by April 18.

City officials are optimistic. In the past, “people knew we weren’t coming after them,” Pospiech said. “Now we are following up on those threats.”

This article was provided by Bloomberg News.