New algorithms could enable heaps of 'smart sand' that can assume any shape, allowing spontaneous formation of new tools or duplication of broken mechanical parts. These algorithms were created by researchers at the Distributed Robotics Laboratory (DRL) at MIT's Computer Science and Artificial Intelligence Laboratory. They also tested the algorithms on somewhat larger particles - cubes about 10 millimeters to an edge. To attach to each other, to communicate, and to share power, the cubes use 'electropermanent magnets' - materials whose magnetism can be switched on and off with jolts of electricity. Each cube has magnets, recognizable by the reddish wires wrapped around them, on four of its six faces.