We’re a little closer to getting all-purpose robots that change shape depending on the job, thanks to researchers who created a way for machines to mind meld.

Shapeshifting robots already exist; they either have a centralized “nervous system” that controls where each unit is, or each of the units works by itself and they sometimes link up. But centralized systems are weak and can’t scale, while self-organizing robots are hard to control and clumsy. Researchers created a new robot that has the strengths of both: the individual units can control themselves — but they can also connect to each other and become a single, precise robot. The study was published today in the journal Nature Communications.

In the new system, the robot is made of different units controlled by one “brain,” sort of like the nervous system in our bodies. This brain is the leader of the pack and, using Wi-Fi, gathers data from the other robots and controls them if they come into contact. “The robots in our multi-robot system are autonomous individual robots that, when they attach to each other, become a new single robot with a single control system,” study co-author Marco Dorigo, wrote in an email to The Verge. Then, if they detach, they go back to being autonomous system with their own control systems. Dorigo calls this new method “mergeable nervous system,” and says it is a more precise way to control all the units.

In other words, the “nervous system” is flexible and can expand or shrink depending on how many new robots it needs to control, Dorigo says. The robots can even “heal” themselves by removing a unit that doesn’t work.

The main limitation is that, right now, you still have to program all the robots to tell them exactly how to merge. But it’s possible for the units to learn, and that’s the next step for Dorigo’s team. And in theory, this method of moving could be able to scale with lots of different units. One day this method could help us create robots that work seamlessly together to move objects, assemble furniture, and make sure we never need to work again.