Sedimentary rock composed mainly of calcium carbonate (CaCO), usually in the form of calcite and, less commonly, aragonite. It may contain considerable amounts of magnesium carbonate (dolomite) as well. Most limestones have a granular texture; in many cases, the grains are tiny fragments of fossil animal shells. Much knowledge of the Earth's history has been derived from the study of fossils embedded in limestone and other carbonate rocks. Limestone is used as a soil conditioner, in the manufacture of glass, and in agriculture. Ornamental varieties are used for flooring, exterior and interior facings of buildings, and monuments.