This one goes out to the head bobbers, the window seat sleepers, and the open-mouth breathers — there is no shame in being able to fall asleep anywhere, and at any time. Be proud, and, if you can’t help it, snore loud.

Scientists have come to a consensus that our bodies definitely need sleep, but we don’t all need the same amount. The next step for them is to figure out where the process of sleep starts and ends in the body. And, like a good movie, one revelation about sleep only leads to another.

Think of yourself as a very minor character in the scientific story of fatigue. The real star of this cozy mystery is the fruit fly, an A-lister in sleep science. Thanks to fruit flies, we understand two of the basic factors that govern sleep: a biological clock, which scientists know a lot about, and a homeostatic switch, which they only just discovered and are beginning to understand.

Let’s start with this biological clock. The clock that is connected to sleep is controlled by a circadian rhythm and uses environmental cues such as sunlight to tell the body when to wake up.

This sun-sleep connection in humans and flies alike got scientists like Russell Foster, a professor at Oxford University in the United Kingdom, asking questions such as: What happens when we don’t have the mechanisms in our eye to distinguish dawn from dusk and send that message to the brain? Why can we still fall asleep according to the circadian rhythm? The answer, Foster said, is that mammals have a third layer of photoreceptors in the eye. It used to be that scientists thought rods and cones, cells that help us process images, were the only ones in the eye that worked to detect light. But when they removed these cells in mice, they noticed that the mice could still keep up with the circadian rhythm. The hidden cells, they found, were intrinsically sensitive to light and acted as a backup measure to keep us on our sleep schedule, whether we can see that the sun is up or not.

Foster also pointed out that being an early riser or a late sleeper is hardwired into our genetic code. It’s a gift from our parents, who, by hereditary law, will always have a say in when we go to bed at night. This, he said, is what makes it so difficult to reset our biological clock when we travel across the world or take up the night shift.

And now, the homeostatic switch. Homeostasis is the body’s system of checks and balances. If you get too cold, your body counteracts that by finding ways to retain heat. Similarly, if your body needs sleep, it finds a way to make you nod off. Mark Wu, a neurology professor at Johns Hopkins University, took the concept of homeostasis and connected it to the idea that when we finally fall asleep, we stay asleep for an extended period. Something, he explained, is responsible for sustaining that sleep mode once it starts. He and his team went searching for this sleep kick-starter in the brain of the fruit fly.

“It wasn’t until about 15 years ago that we figured out that flies actually sleep,” Wu said. He told me that we can tell a fly is sleeping the same way we can tell that a dog might be sleeping. The dog doesn’t move and its eyes are closed, and if you disturb it, it is jolted out of the state. Fruit flies meet all the same criteria. Plus, if you give a fruit fly coffee or amphetamines, it stays awake just as humans do.

The homeostatic switch model that Wu and his colleagues came up with is a spinoff of a much older idea. Back in the early 1900s, a team of scientists took dogs and kept them awake. Then they took brain fluid from the sleepy dogs and injected it into well-rested ones. The well-rested dogs immediately got drowsy, suggesting that something circulating in the brain fluid was encoding sleep. This introduced the possibility that molecules outside a cell might play a role in causing fatigue. Since then, researchers have been making guesses at what those molecules might be — but Wu said he and his colleagues didn’t believe most of the candidates quite fit the bill.

“We had one major problem with the model,” he said, “which was that most of the things that had been implicated, like adenosine, had a short half-life.” That is, if you stay awake, adenosine molecules in your brain increase, and when this happens, you start to feel tired. But the body uses up adenosine quickly, and levels don’t stay elevated for more than a few minutes.

“When you go to bed, if you wake up after five minutes, you’re still sleepy. That drive persists for hours, not a couple of minutes, which let us know that maybe a circuit was encoding drive,” Wu said. He likened the neural circuit to the compressor of an air conditioning unit: It turns on if the temperature in the room doesn’t match the temperature that is set. To identify the neurons that might be acting like a sleep switch, he and his team activated neurons in the fruit fly a few at a time until they found the ones that seemed to encode sleep drive. They discovered that if you turned those neurons on even briefly, the fly appears sleepy for hours, which had never been seen before in any animal.

Taking Wu’s findings one step further, Gero Miesenboeck, another researcher and a professor at Oxford University, homed in on what controls a fruit fly’s sleep switch. His team figured out how to turn the switch off — by increasing dopamine levels that changed the structure of the cell — but not how to switch it back on again. That is, they could keep the fly awake, but they have yet to figure out how to control the genes in a way that would make the fly instantly drowsy.

Both Wu’s team, which found the likely circuit, and Miesenboeck’s team, which wants to figure out how to control it, are racing to discover what flicks the sleep switch on and off. Meanwhile, Stanford researchers are exploring how the sleep circuit is connected with other ones, like the one that rings the alarm for hunger. They found one neural circuit, which we can unscientifically call the “overlord circuit” that might be working to control not only sleep, but also hunger, reproduction and survival.

That’s as far as the story goes for now: The sun guides us on when to sleep and when to wake by setting off a reaction in our bodies that jump-starts our neurons. These neurons, which are programmed partly by genes that establish whether you naturally wake up early or late, work like a circuit that is being powered by one or more molecules in the body that scientists are still trying to nail down. And after that, they will have to see how it all fits into the interconnectedness of our other brain cells. Like I said, one revelation only leads to another.

Foster pointed out that humans have a tendency to ignore sleep (cough, coffee addicts) but we do so at our peril. He added that getting enough sleep could help with a whirlwind of problems such as dealing with memory loss, controlling moods and impulsiveness. What he forgot to mention is that respecting the body’s need for sleep is the perfect way to get rid of the intense guilt that comes with not rolling out of bed to exercise in the early morning, yet again.