Scientists have solved a long-running mystery surrounding marimo, the fuzzy balls of green algae that Japan considers a national treasure.

Though marimo are known for nestling adorably at the bottom of rivers and lakes, they’re not always bottom dwellers. They sink at night, but during they day, they float—and until now, researchers weren’t quite sure why. As Atlas Obscura reports, a new study gets to the bottom of the mystery: It’s photosynthesis.

The study, published in Current Biology, finds that floating and sinking are natural byproducts of the marimo’s circadian rhythm driven by photosynthesis.

During the day, bubbles form within the spherical balls of Aegagropila linnaei algae, making them float to the surface of the water. In order to find out what drives the formation of these bubbles, researchers from the University of Bristol used a chemical that blocks photosynthesis. They found that bubbles didn’t form on chemically altered marimo, nor did the algae balls float, even when they were exposed to 48 hours of constant light.

Once they knew that photosynthesis was key to marimo buoyancy, the researchers exposed their lab-grown marimo to different light conditions in order to test whether their circadian rhythm plays a role in floating. The marimo were exposed to 12 hours of darkness and 12 hours of light during the day, then transferred to an environment with constant dim, red lighting for a few days. When the researchers then exposed these algae balls to bright light at the beginning of the day—mimicking the natural light cycle—they found that the marimo floated to the top of the water quicker than they did if they were exposed to bright light in the middle of the day. Basically, the marimo had jet lag.

The researchers suggest that this day-night buoyancy cycle might help the marimo maximize the amount of light they get each day. Since there’s less light at lower depths (like at the bottom of a lake), marimo float to the top of the water to maximize their potential for photosynthesis each day.

Marimo are endangered in the wild, and are no longer found in many of the lakes that were once teeming with the balls of algae. Given that photosynthesis drives the marimo’s daily cycle, these population changes could be due to pollution changing how much light penetrates the water in those lakes, according to Dora Cano-Ramirez, the study’s first author.

[h/t Atlas Obscura]