Astronomers show how planets form in binary systems without getting crushed