When you’re feeling tired during the day, what do you normally do? If you’re feeling cranky and have 20 minutes to spare, there’s something that many scientists are recommending.

Instead of drinking coffee or taking a nap, try doing both things. It’s called a “coffee nap” and scientists agree that they are actually more effective that drinking coffee alone or napping alone. Basically, you caffeinate right before you sleep for 20 minutes to maximize your alertness. Here’s how it works according to Vox:

[S]leeping naturally clears adenosine [byproduct of brain activity that makes you feel tired] from the brain. If you nap for longer than 15 or 20 minutes, your brain is more likely to enter deeper stages of sleep that take some time to recover from. But shorter naps generally don’t lead to this so-called “sleep inertia” — and it takes around 20 minutes for the caffeine to get through your gastrointestinal tract and bloodstream anyway.

So if you nap for those 20 minutes, you’ll reduce your levels of adenosine just in time for the caffeine to kick in. The caffeine will have less adenosine to compete with, and will thereby be even more effective in making you alert.

There have been several studies worldwide that have shown the benefits of coffee naps. At the Loughborough University in the UK, researchers found that participants in their study went on to commit fewer errors in a driving similator than when they were just given coffee, only took a nap or were given a decaf placebo. A Japanese study found that people performed better when taking a series of memory tests when they took a coffee nap beforehand. And yet another study found these surprising results:

As part of one study, 24 young men went without proper sleep for a 24-hour period, taking only short naps. 12 of them, who were given just a placebo, performed markedly worse on a series of cognition tests, compared to their baseline scores. 12 others, who had caffeine before their naps, managed scores roughly the same as their baselines for the entire day.

So when you need a boost, just drink a cup of coffee (as quickly as you can). Then take a 20 minute nap. It doesn’t matter if you can’t really fall into a deep sleep – just a half-sleep state can still help. Then, make sure you wake up within 20 minutes and you should wake up with a new skip in your step!