Astronomers find potential solution into how planets form