What process was responsible for producing gases and formed the early atmosphere?