Researchers have developed a robot that finds and kills a starfish that does the greatest damage to Australia’s Great Barrier Reef.

The crown-of-thorns starfish accounts for 42 percent of the decline in coral cover, according to a story on Quartz. Using human divers to kill the starfish has been a failure because there aren’t enough divers to cover “the COTS hotspots” on the ref, co-researcher Matthew Dunbabin tells Quartz.

Enter COTSbot. Armed with cameras, GPS, five thrusters, an extentable injection arm, sensors, and an artificial intelligence system, the robot can scour the reef for up to eight hours and punch more than 200 lethal shots of bile salts into crown-of-thorns starfish.

The salts kill the starfish within 24 hours. Scientists trained the robot to recognize COTS by showing it pictures of the starfish. The device identified the correct starfish 99.4 percent of the time in lab tests.