After he lost a 2010 judicial election in Will County, Chicago, Polish American Philip Spiwak needed to take a new approach to win.

Using an old 19th-century trick, he legally changed his name to Shannon P. O’Malley for his election battle in the usually reliably Republican 13th Sub-Circuit Court election.

“The advantage of an Irish-sounding name in Cook County has long been accepted as gospel truth,” wrote researcher Albert J. Klumpp in a 2011 study for the DePaul Law Review.

Cook County elections in the recent past have favored female candidates more than males.

“Having both an Irish and female-sounding carries a 24.7 percent advantage, a much greater advantage than political affiliation” Klumpp adds.

Read more: This Election week, channel the Irish suffragette who followed Churchill around ringing a bell

Spiwak dumped his Polish surname and took on one closer to Chicago voters’ instincts, dubbing himself Shannon P. O’Malley.

Speaking to NBC news earlier this year, however, the lawyer and father of one denied speculation that he changed his name solely to get ahead; instead, maintaining the name change was to honor his "mentor and surrogate father."

Turns out Spiwak (55) isn't the first person to think of this trick either. In 1990, the New York Times published an article entitled, Illinois Journal: Where an Irish Name Wins Everyone's Vote.

The article explained: "This is the County of Cook, not Cork. And contrary to rumor, the election ballots in Illinois next month will not be printed in Gaelic. But an Irish name, and sometimes two, will appear on the ballot ... Over the years, more than one candidate for judge here has legally changed names to sound Irish. And for good reason: Voters in the Democratic primary here in 1984, for example, ousted four party-endorsed incumbent judges in favor of relatively obscure lawyers named Tully, Shelly, Kelly and Flanagan."

Read more: How an Irish presidential election inspired my first novel – and helped me adjust to life in Ireland

A 2007 Illinois state law attempted to bring an end to the frequency of candidates changing their names in order to gain an electoral advantage by requiring them to disclose their former names on the ballot alongside their new ones.

As O'Malley changed his name more than three years ago, this law does not apply to him.

It worked either way! Shannon O’Malley alias Spiwak won a judgeship on Tuesday. getting over 57,000 votes. The luck of the Polish/Irish!

After he lost a 2010 judicial election in Will County, Chicago, Polish American Philip Spiwak needed to take a new approach to win. Getty