If you were in a hospital staring at a scan of your chest, and the radiologist was pointing to a bulbous aneurysm, and you could shrink it immediately by surrendering a breakfast pastry, most people would.

But when the pastry is right there in front of you and the aneurysm is remote and hypothetical, we eat pastries for breakfast.

There’s a concept in behavioral economics called temporal discounting. It means that the further out (in time) a reward is, the less valuable it is to us right now. The classic example is a person choosing $10 today instead of $15 next month. Applied to health, it means people choose soda and shelf-stable pastries now over cardiac function later. A habitual proclivity for instant gratification might not be the problem so much as an environment that makes unhealthy food instant (and a sugar-centric understanding of gratification).

If risks were more immediate and gratification less so, we’d likely do better at feeding our bodies. At least, Brad Appelhans thinks so. He’s a health psychologist at Rush Medical College’s department of preventive medicine, where he studies neurobehavioral influences on nutrition. And today he’s rolling out a novel invention that could put theory into practice—or at least help us examine why we make some of the decisions we do.

“If we want to prevent chronic disease, we need to change a lot of behaviors. That includes eating, a lot of which happens impulsively,” he said. “Delicious food is all around us, but having a heart attack is years down the road. Even though most people would rather forego a Twinkie than have a heart attack.” (Of course, a long life without a heart attack isn’t the guaranteed alternative to eating a Twinkie. But the most common causes of death are conditions that are strongly influenced by diet.)

Appelhans takes the train to work every morning, and he noticed at his stop there’s an automated door. Few people ever use it because there’s a plaque engraved above it that says “Door on 3 Second Delay.” It’s just enough to make most bipedal people open another door using their own muscles and precious energy.

There have been a lot of studies about delayed discounting and health outcomes, but not on practical ways to leverage that principle by changing the environment. So he tried to put that concept into practice, by making the less healthy choice less instant. Few situations in nature offer experimental conditions for studying food choices as purely as vending machines. And the hot trend in vending right now is, apparently, something called “healthy vending.”

“Healthy vending is where it’s at,” Appelhans told me, as though I should’ve known. “If you follow industry reports they have sentences like, The next 10 years is all about healthy vending."

The problem is that has usually meant simply restricting choices available or taxing junk food or discounting healthy food. Those things aren’t especially appealing to sites or users. That means the site loses money. So but what if there were a way to offer healthy vending without having to restrict choices, lose revenue, or change the price?

To test the possibility, Appelhans made a vending machine. Out of parts procured at Radio Shack, his team at Rush created a sort of monster vending machine, or a vending machine from hell. They call it DISC (Delays to Influence Snack Choice), and it has the capacity to selectively delay delivery of unhealthy snacks. It looks like a normal vending machine, but the glass pane on the front is adorned with a giant stopwatch that says in a red font, “Regular snacks vend after a 25-second delay.” Below, in green, “Healthy snacks vend instantly.” The healthy snacks are in a green section in the lower half of the machine, and the “regular” snack in the red upper half. The labels themselves must have some affect, I think.

If a person chooses a “regular” snack nonetheless, the machine holds it on a platform for 25 long seconds. Possibly while people in line behind you glare and pass judgment. Even still, the effect was small, Appelhans found. “People’s preferred choices are pretty stable. When someone goes to a vending machine with an idea about what they want, it’s quite difficult to nudge them.”

But after several months of vending machine use in heavily trafficked areas in public and office spaces in Chicago, the team found that the machines saw a 3-to-5-percent shift toward healthier food. The change is small but possibly consequential were it applied across 1.3 million vending machines in the U.S. with $4 billion in annual sales, of which the top 20 best-selling “snacks” are candy, pastries, and chips.

The team presented their findings today at the annual conference of the Society of Behavioral Medicine. If they are well received, a next step could be partnership with vending companies. I asked Appelhans why any vending company would even consider adopting a technology that effectively serves as a barrier between the product and the customer.

But after more than 36,000 transactions, it turned out that barrier didn’t affect sales. Maybe a few people were dissuaded by the giant stopwatch and admonishment from the machine, objecting in principle or practice to subversion of the autonomy we are taught to believe we have, but slightly fewer sales ultimately didn’t mean less revenue. Some people might even prefer a vending machine that’s helping them make a decision that might keep them healthy.

I haven’t used a vending machine in seven years, but Appelhans is convinced I should care about this concept because it’s not really about vending machines. “You can influence vending machine snacks, sure, but more interesting is how do you use that principle in other settings,” he said.  “Potentially a fast-food place or cafeteria. The best imaginable situation would be at a supermarket, where perhaps there's a way of collecting healthier options really easily and being able to pay for them really quickly, maybe bypassing a line.”

For example, if your cart met a certain criteria for healthiness, he posits, maybe you get to go in an express lane. Being the cart inspector would be an amazing job. Or maybe the horrible foods are on a tall shelf, and to get them you have to climb a long ladder?

In the immediate term, if someone wanted to apply this concept outside of hoping for hypothetical coercive vending machines or dangerous grocery stores, he recommends setting up your day-to-day environment so that healthy foods are more immediately accessible than junk food. If you don’t buy it, you can’t eat it, so never shop hungry. If you have to keep junk in the house for some reason, don’t make it extremely accessible. Certainly don’t keep it in your line of sight. A candy dish or cookie jar is a bad idea but can easily be converted to a radish dish or a nut jar.

The professor also had an idea I wasn’t familiar with. “Putting some tempting snacks in the freezer will create a time delay while they thaw out, and people may realize that they can settle for a healthier snack right now rather than waiting out the thaw. There are also devices one can buy which lock away temptations for a period of time. (One is called the Kitchen Safe).”

The freezer approach also works for things besides food, I imagine.