These cows are dressed up to look like zebras, but not because they’re in the moo-d for Halloween.

A group of agricultural researchers are giving cows zebra-like stripes because they seem to deter biting flies, which may be an ecologically friendly way to fight off the blood-sucking pests.

According to a Public Library of Science report, zoological experts believe that one function of a zebra’s black-and-white-striped pattern is to ward off biting insects, which have been shown in previous studies to prefer solid surfaces over patterned.

To test the theory, livestock scientists from the Aichi Agricultural Research Center in Japan outfitted six black cows three ways: unpainted (black); painted with thin white stripes; and painted with a thick black-and-white-striped pattern mimicking a zebra. When researchers compared how often flies bit each bovine cohort, they found the group with a striped pattern suffered 50% fewer attacks.

Scientists don’t know exactly why flies avoid the striped animals. Some hypothesize that the pattern could be disorienting or confusing; other studies have shown that they prefer landing on a white surface, so black stripes receive fewer bites.

The study isn’t just about making cows more comfortable, either. In their report, the authors write that damage caused by biting flies costs the United States cattle industry an estimated $2.2 billion per year. Usually, farmers use insecticides to defend their livestock, but insects have historically evolved to gain resistance to common pesticides, making them increasingly difficult to control. Moreover, pesticides and insecticides create issues with air and groundwater pollution, as well as encourage drug-resistant parasites.

The researchers conclude that artificial striping “provides an alternative method to the use of pesticides for defense against biting flies,” adding it may also be “beneficial to the environment and human health.”

But until a human study is conducted, remember to paint stripes the nontoxic way.