There are approximately 25,000 bars and restaurants in New York City, which shouldn’t surprise you, seeing as it’s the second-largest metro area in the world and all those people have to eat and drink somewhere, after all. But unless you’re weirdly familiar with archaic NYC legislation, here’s a stat that’s considerably crazier: Technically, you can only dance in just 97 of those establishments.

It’s true: More than 99 percent of pubs, clubs, and other eateries in the city have to cut through a ridiculous amount of red tape—outlined below—if their patrons are to cleanly cut a rug without violating the Cabaret Law, which has existed since 1926. Fortunately, the 91-year reign of terror has to come to end, as New York’s City Council has finally voted to repeal the long-outdated rule.

You can expect lots of celebratory (and legal!) cavorting now that the law has been lifted, but in the meantime, you’re probably wondering: Why the hell was it ever passed in the first place?

The answer, which is an appropriate explanation for most burning questions these days, is pretty simple: because racism! Back in 1926, Mayor Jimmy Walker made it illegal for clubs to host “musical entertainment, singing, or other form of amusement” without a license, according to The New York Times. While the justification for the Prohibition-era regulation was so that cops could shut down illegal speakeasies, the decree was also meant to target jazz clubs in Harlem, where white and black people danced with each other. Gasp!

Additionally, the very, very stupid Cabaret Law made it illegal for more than three musicians to perform at once, and outlawed percussion, brass,= and wind instruments. (In other words, jazz.) From 1940 to 1967, in fact, musicians had to carry around “Cabaret cards” that permitted (and prohibited) them to play venues, based on their criminal records. As a result, jazz legends like Thelonious Monk and Charlie Parker were banned from certain clubs.

In the ensuing decades, police grew a lot more lax about actually carrying out the increasingly dumb law, and it hasn’t been “aggressively enforced” since the Giuliani administration in the 1990s, according to the Times. Nevertheless, a bar must still jump through several hoops to allow dancing inside—such as paying fees, installing security cameras, and getting permission from the FDNY—which is why so few spaces actually have a special license. And the reason the rule has survived for so long is because communities have continued to fight off a repeal in fear of loud noises emanating from local watering holes late at night.

But Brooklyn Councilman Rafael Espinal, who introduced a repeal bill, told the Times he had the necessary votes to strike down the law at last. “It’s over,” he said, like a madman hell bent on busting loose. And as of now, repressed New Yorkers will finally know what it’s like to have fun.