The TRAPPIST-1 system looks more like Jupiter and its moons than our own solar system. Seven planets orbit in an elaborate synchronous dance around a star only slightly larger than Jupiter. Those seven planets are constrained within a 3 million-mile space and all of them are between the size of Mars and a slightly-larger-than-Earth rocky planet. Oh, and at least three of the planets are habitable.

And now, a group of University of Amsterdam professors believe they know how it formed. And they think it happened rock-by-rock.

Solar systems typically form from nebula – as gas accumulates and clumps, it forms a star, which then helps gravitationally shape planets. But in a small system like TRAPPIST-1, the planets have to stay close in order to keep gravitationally bound. In the TRAPPIST system, the first batch of planets formed from material leftovers — clumps of dirt and ice — then migrated outward. At a certain point they reach a place where water sublimes into vapor, and water accumulates onto that ice and rock. It becomes enough material to smoosh into a proto-planet and migrates closer to the star.

The end result? Seven icy, Earth-sized worlds. Chris Ornell, lead author of the paper recently accepted to the journal Astronomy and Astrophysics, said in a press release, “We have been working on pebble aggregation and sweep-up by planets for a long time and were also developing a new ice-line model. Thanks to the discovery of Trappist-1 we can compare our model with reality.”

This method of accumulation also helps settle why the system seems to have no gas giants like Neptune or Uranus, at least that we know of. It’s unknown yet if such a mechanism creates atmospheres on the planets or how this might affect habitability in the system.