New light shed on how Earth and Mars were created