Though worms are often associated with seventh grade science dissection or how to eat fried versions of them, these little critters are more fascinating than you think.

As you may know, worms have the ability to regenerate. However, scientists discovered that if you cut off a worm’s head, once the head grows back, the worm’s new brain is able to retain the same memories. So, if a worm has a traumatic memory of accidentally calling their first grade teacher “mom”, that memory won’t go away if their head gets chopped off and they regrow a new one.

Biologists Tal Shomrat and Micahel Levin discovered this through a series of experiments where they trained the worms to perform a different task. In this instance, they trained worms to find food in the center of a petri dish. Most worms hang out on the edges of a petri dish because I guess that’s where the cool worms hang out. After the worms mastered finding their nourishment, Shomrat and Levin cut off the worms’ heads. Once the heads grew back, the scientists found that with little retraining, the worms were able to remember to venture to the center of the petri dish for food.

Why is this possible? Shomrat and Levin believe epigenetics may play into this phenomenon. Epigenentics is the study of changes in gene expression beyond (or above, hence “epi”) what our DNA dictates. If DNA is our blueprint, epigenetics is how or why our blueprints are designed in a certain way.

In addition to epigenetics, the biologists believe that a chemical signal outside of the worms’ brain may also contribute to them being able to retain old memories.

For more information, you can read their research article in the Journal of Experimental Biology.