One theory suggested that about 360 million years ago, some plants evolved the ability to produce lignin, a complex polymer that made their cellulose stems much harder and more woody. The ability to produce lignin led to the evolution of the first trees. But bacteria and fungi did not immediately evolve the ability to decompose lignin, so the wood did not fully decay but became buried under sediment, eventually turning into coal. About 300 million years ago, mushrooms and other fungi developed this ability, ending the main coal-formation period of earth's history. However, a 2016 study largely refuted this idea, finding extensive evidence of lignin degradation during the Carboniferous, and that shifts in lignin abundance had no impact on coal formation. They suggested that climatic and tectonic factors were a more plausible explanation.