The first frequent flyer program was put in place by the now defunct Texas International Airlines in 1979. Their program was quickly adopted by competitors and has since become a hallmark of the airline industry. And as these programs increased, flyers looked at ways to game the system, aiming to rack up huge amount of points for cheap or, at times, free. At times, they have found success.

Two loopholes which have since been closed (sorry) involve purchasing currency or the equivalent. A few decades ago, miles collectors would open up credit card accounts which earned them miles for each dollar spent. Then, these cardholders would buy travelers’ checks up to the monthly credit limit amount on the card. They’d end up with a ton of miles and, yes, a huge credit card bill, but they would pay off that debt with the thousands of dollars of travelers’ checks now in their possession. When this loophole closed, a similar exploit emerged, taking advantage of the U.S. Mint’s desire to place $1 coins into circulation (which would turn into a billion dollar failure). The Mint allowed consumers to buy coins directly, at face value, using their credit cards. Miles collectors racked up a seemingly infinite amount of miles, buying cash with credit, before the Mint put the kibosh on it.

These flighty schemes, however, were pedestrian compared to what a man named David Phillips figured out — a loophole which would allow him to have his cake and eat it, too.

Actually, make that pudding.

Before June 1, 1999, food company Healthy Choice offered 1,000 frequent flyer miles for every 10 Healthy Choice products purchased. For more expensive items like entrees, that was a nice but small incentive to try a new product. But David Phillips, then of Davis, California, noticed an opportunity. Healthy Choice made small pudding cups, each with their own UPC code, which retailed for about a quarter apiece at local outlet stores. He bought them all.

“All,” meaning every single Healthy Choice pudding in fifteen different such stores. And even then, he wanted more. He asked a store manager to order him even more pudding — sixty cases of 144 units each (seen above), as he recounted on frequent flyer community website FlyerTalk.com. In total, Phillips spent just over $3,000 purchasing 12,150 cups of pudding, and collecting 1.2 million air miles in the process. That, roughly, was worth 30 round trip coach tickets to Europe.

The hardest part of the endeavor? Pulling off all the UPC codes. But Phillips had an elegant solution there, too. He donated most of the pudding to local food banks and, in return, asked them to remove the UPC codes and return them to him when the pudding was served. As a bonus, Phillips took an $800 tax deduction for the donation of all that pudding.

Bonus fact : In the late 1990s, Pepsi ran a “Pepsi Points” campaign similar to the Healthy Choice one above, the difference being that the points could be redeemed for various Pepsi-branded products, such as t-shirts, instead of air miles. In one TV ad promoting the Pepsi Points (see it here) the company, jokingly, claimed that you could get a Harrier fighter jet for 7 million Pepsi Points. One enterprising person, a guy named John Leonard, figured he would take Pepsi’s joke offer seriously. He noticed that the Points rules allowed people to buy Points directly (without buying Pepsi cola itself) for 10 cents a point, plus a $10 shipping and processing fee on top. Leonard had 15 Points and, in an effort to obtain the other 6,999,985 points, sent Pepsi a certified check for $700,008.50 and requested his Harrier jet, worth about $23 million. Pepsi said no. So Leonard sued — and lost.

From the Archives: The Candy Desk: Another combination of loopholes and sweets.

Related: Pudding.