In the early stages of its development, with the hot gases condensing and molten matter which was solidifying to form what are rocks, today, the Earth acted as the huge factory, producing many kinds of compounds. The sources of energy available for the formation of numerous type of molecules were cosmic rays, ultraviolet radiations, electrical discharges such as lightning, radioactivity, and heat from volcanoes and hot springs. Molecules of all sorts were being continuously created and destroyed due to their state of agitation. The lighter gases of the atmosphere such as hydrogen, helium, oxygen, nitrogen, etc.. . Again, nitrogen, hydrogen and oxygen combined together to form ammonium nitrate. Compounds of carbon and hydrogen were also formed sometimes along with nitrogen or oxygen. These compounds are, today, called "organic compounds”. The Earth had at the same time started cooling down. As the Earth cooled sufficiently, torrential and prolonged rains were caused due to condensation of steam. This allowed living organisms to come to the surface of water and to survive even on land, if they got thrown out of the swirling and splashing water.