Scientists from nonprofit Elephants Without Borders working in Botswana recently discovered that disco lights are an effective and safer deterrent to keep elephants away from farmers’ fields, the BBC reports.

Home to the world’s largest elephant population, Botswana frequently deals with human and elephant interaction, with the majestic giants often passing through farming areas to access the Chobe River for drinking water. At times, crops are unintentionally harmed, and rural communities and elephants are still figuring out how to live harmoniously with one another.

Barking dogs and fences have failed to reroute elephant herds away from farmland, but locals discovered that flashing lights seem to work. Pursuing this idea, scientists from Elephants Without Borders placed solar-powered strobe lights along a field where elephants were previously seen passing through. They tested this method over a two-year period and recorded their observations, which were recently published in the Cambridge University Press journal Oryx.

The strobe lights proved to keep wandering elephants away from farmers’ land without harming them, marking an important step toward establishing a peaceful coexistence between humans and pachyderms in Botswana. Moreover, the lights are easily movable, enabling farmers to create safe, non-intrusive barriers on an as-needed basis.

The decreased damage to crops resulting from the strobe lights eases the increasing tensions between humans and elephants. At the very least, the lights represent a promising start toward sustainable, long-term solutions to the ongoing competition for land and resources.