Africa’s black market in ivory doesn’t just sell an illegal product: recent estimates confirmed it stokes a poaching epidemic that killed hundreds of thousands of elephants over the past decade. Now, reports BBC’s Jonathan Ball, there’s a new weapon in the fight to figure out just who is killing elephants — the poop of elephants themselves.

The secret is in something both elephant feces and ivory have in common: DNA. A team of conservation biologists is using genetic analysis to create population maps using DNA from samples of elephant poop across Africa. Over 1,500 samples have yielded a map that makes it possible to match illegal ivory to the habitat it came from.

It took over 15 years to gather, analyze and map the elephant dung, writes Erik Stokstad for Science, where the team’s research was recently published. After creating their maps, the scientists turned to ivory seized by government officials throughout Africa. What they found, they write, has major “implications for law enforcement efforts aimed at tackling transnational organized trade in ivory.”

Seized ivory appeared to come overwhelmingly from two areas. Forest elephants whose tusks were seized were mostly killed in TRIDOM, a protected forest area that spans parts of Gabon, Cameroon, and the Republic of Congo. And when savannah elephants were killed, they were usually in game reserves in Tanzania and Mozambique.

The team hopes their work will lead to tougher laws and force countries that host poaching hotspots to take responsibility for the slaughter of elephants for ivory. In a release, they note that roughly 50,000 elephants are killed each year for ivory.

Analyzing dung isn’t the most glamorous of tasks, but someone has to do it. It’s seen as a real responsibility by scientists who, in the words of study lead Samuel Wasser, are taking matters into their own hands: “When you're losing a tenth of the population a year, you have to do something more urgent — nail down where the major killing is happening and stop it at the source.”