Four and a half billion years ago, the place we now call the solar system was a vast cloud of gas and dust enshrouding a newborn star. Gradually those dust grains cohered and formed pebbles, which then collided and coalesced into boulders. Over the course of about 100 million years, most of the material in that nebulous cloud accreted into the existing eight planets—four rocky (including Earth) and four gaseous. Or at least that’s how astronomers thought the story went.

Last November astronomer David Nesvorny of the Southwest Research Institute in Colorado added a new character to the tale. Nesvorny, who runs computer simulations to study how the solar system evolved over time, kept encountering the same problem: The four giant gas planets, whose orbits are comfortably far apart from each other today, kept violently jostling with each other in his models of the early solar system. Jupiter would end up tugging on Uranus or Neptune and casting one of them out into interstellar space. Obviously, that never happened. So Nesvorny came up with a clever explanation: He proposed that a fifth gas giant emerged from the planet-birthing cloud 4.5 billion years ago. Suddenly his simulations started matching reality. The outer planets still jockeyed for position, but this time Jupiter spared Uranus and Neptune and ejected the extra planet instead. The loss of the extra world also shifted the orbits of the surviving planets. Jupiter darted toward the sun, while Uranus and Neptune got shoved farther away to the positions they have today. Nesvorny says all this instability could explain the Late Heavy Bombardment, a period when small objects at the edge of the solar system got rounded up and flung toward Earth and the other inner planets.

Nesvorny’s study in The Astrophysical Journal Letters came out just as other scientists announced that our galaxy may contain hundreds of billions of rogue planets floating aimlessly through interstellar space. If Nesvorny is correct, one of them may be our long-lost neighbor.