Since only hydrogen and helium (with very small trace amounts of Lithium and Beryllium) were produced at the beginning of the universe, all of the heavier elements have been produced in stars or in interstellar space by cosmic ray bombardment as shown in the diagram on the left. The heavier elements are often lumped together as metal in astronomical terminology. At the end of a star's life, it recycles some or all of the elements it has produced in it's core over it's lifetime back into the interstellar medium. This processed material becomes mixed into clouds where the next generation of stars are born. So each subsequent generation of stars is enriched with the metals produced in previous generations. Thus we can infer in a closed system, like the Milky Way, that stars with a lower metal content are older than stars with a higher metal content. The metal poor stars are called population II stars while the population I stars are relatively rich in metal. The amount of metals in a star can be measured by the absorption lines in stellar spectrum.