By studying flies, researchers have identified a gene that induces sleepiness—and protects against infections, reports The Atlantic.

Toda began by looking for genes that, if switched on, would make flies sleepier. To that end, he worked with flies from 8,000 different strains that had each been engineered to activate a different gene when fed a triggering chemical. Toda placed these flies individually into tubes that were monitored with infrared beams. When awake and mobile, the insects regularly tripped the beams; when asleep and still, they did not. A computer monitored the entire captive swarm, recording their movements and noting any that were sleeping more than usual.