Professional poker player Phil Ivey, a 10-time World Series of Poker bracelet winner, has been ordered by a federal judge to give back more than $10 million dollars in winnings to Atlantic City's Borgata casino. The order comes two years after Ivey and his associate, Cheung Yin Sun, were sued by the establishment for allegedly "cheating" at baccarat.

Both Ivey and Sun argued that they simply used observation and skill to amass a fortune while playing at the Borgata. They claimed they used a technique called edge sorting, which was detailed in depth by The New York Times this past summer. As the Times explains:

Sun visited several Las Vegas casino gift shops and bought souvenir decks of playing cards. They look identical to those used at the gaming tables but have holes punched through their centers to prevent cheaters from slipping a souvenir ace of spades, say, into a poker game. Sun had no such intention. She scrutinized the backs of the cards. Some had crisscrossing patterns that went right to all four edges.

The patterns on these cards, as a consequence of the manufacturing processes, were trimmed slightly differently on top and bottom, resulting in uneven margins of 1/32 of an inch or less. She spent around a thousand hours, over four years, training herself to recognize the minute variations on particular cards. Sun figured out how she could leverage these differences that were almost imperceptible and acceptable by industry standards. She wasn’t the first to recognize this vulnerability and capitalize on it. But she expanded on the strategy of exploiting unmatched trims, a ploy that has long been known as “edge sorting.” Sun applied it to a baccarat spinoff called mini-baccarat and earned herself a nickname, the Queen of Sorts.

After mastering the painstaking edge sorting process, Sun eventually got Ivey on-board with the strategy. Ivey did the betting, and Sun did the edge sorting, tipping him off as to when to wager on the banker and when to wager on the player. Frankly, like card counting, it seems like a fair strategy, but as you may have noticed, casinos seem to have carte blanche to refuse payments to whoever the hell they want. And apparently, the courts backed the Borgata on this one.

Not coincidentally, this is the second time Ivey and Sun have lost out on eight figures due to edge sorting, as back in 2011, they were refused a payment of $11.7 million by London-based casino Crockfords. Ivey still seems to be doing pretty well for himself, but missing out on $20 million doesn't sound like much fun.