By inserting a genetically modified virus into a guinea pig’s heart, researchers have come up a new kind of pacemaker.

Of the billions of cells in the human heart, a mere 10,000 pacemaker cells—collectively called the sinoatrial node—are responsible for sending the electrical pulse through the remaining heart cells. Pacemaker cells are differentiated in the embryo, but with age and disease their beating can speed up, slow down, become irregular, or even stop. In these instances doctors would normally implant a pacemaker to jolt the heartbeat back into line when needed. But these electronic devices can break, run out of batteries, introduce infection or be outgrown.

The ideal solution, then, would be a replacement pacemaker that is built and powered by the body. And researchers at the Cedars-Sinai Heart Institute are on their way to creating just such a thing.

When pacemaker cells are developing in the embryo, a particular gene—Tbx18—is also activated. Researchers inserted this Tbx18 gene into a virus and inserted that virus into normal, adult guinea pig heart cells. In a matter of days, these cells morphed into pacemaker cells and began sending heartbeat signals of their own. The approach is similar to the reprogramming of heart scar tissue to function like normal heart cells, but in this case the researchers were reprogramming the heart’s pacemaker, thus controlling the beating of all other heart cells.

The effects lasted even after the Tbx18 had faded away, so researchers suggest the structural change is permanent and might offer long-term treatment for patients with heartbeat irregularities. At this point, though, the research, which was published in Nature Biotechnology this week, is far from use in humans.