The scientists let the worms’ heads grow back and found that their memories returned along with the new noggins, according to a new study in the Journal of Experimental Biology.

Michael Levin and Tal Shomrat, biologists at Tufts University, have been studying how animals store and process information, whether it’s memories in the brain or the blueprint for developing organs in the body.

The team turned to flatworms because, despite their relative simplicity, they have many of the same organs and body organization as people: a brain and nervous system, bilateral symmetry, and even some of the same behaviors.

Flatworms “also have many of the same neurotransmitters as we do, and have been shown in older studies to remember complex tasks,” Levin said.