The formation of the solar system