After a star has formed, it generates energy at the hot, dense core region through the nuclear fusion of hydrogen atoms into helium. During this stage of the star's lifetime, it is located along the main sequence at a position determined primarily by its mass, but also based upon its chemical composition and other factors. All main sequence stars are in hydrostatic equilibrium, where outward thermal pressure from the hot core is balanced by the inward gravitational pressure from the overlying layers. The strong dependence of the rate of energy generation in the core on the temperature and pressure helps to sustain this balance. The main sequence is sometimes divided into upper and lower parts, based on the dominant process that a star uses to generate energy. Stars below about 1.5 times the mass of the Sun (or 1.5 solar masses) primarily fuse hydrogen atoms together in a series of stages to form helium, a sequence called the proton-proton chain. Above this mass, in the upper main sequence, the nuclear fusion process mainly uses atoms of carbon, nitrogen and oxygen as intermediaries in the CNO cycle which produces helium from hydrogen atoms. Energy generated at the core makes its way to the surface and is radiated away at the photosphere. The energy is carried by either radiation or convection, with the latter occurring in regions with steeper temperature gradients, higher opacity or both. Main sequence stars with more than ten solar masses undergo convection in the core region, which acts to stir up the newly created helium and maintain the proportion of fuel needed for fusion to occur. When core convection does not occur, a helium-rich core develops surrounded by an outer layer of hydrogen. Main sequence stars below 0.4 solar masses undergo convection throughout their mass. In general, the more massive the star the shorter its lifespan on the main sequence. After the hydrogen fuel at the core has been consumed, the star evolves away from the main sequence on the HR diagram. The behavior of a star now depends on its mass, with stars below 0.23 solar masses becoming white dwarfs, while stars with up to ten solar masses pass through a red giant stage.[1] More massive stars can explode as a Type II supernova.[2]