Coal is a combustible black or brownish-black sedimentary rock normally occurring in layers or veins called coal beds or coal seams. The harder forms, such as anthracite coal, can be regarded as metamorphic rock because of later exposure to elevated temperature and pressure. Coal is composed primarily of carbon along with variable quantities of other elements, chiefly hydrogen, with smaller quantities of sulphur, oxygen and nitrogen. Coal is primarily used as a solid fuel to produce electricity and heat through combustion.