Until the mid-15th century, Beijing residents relied on wood for heating and cooking. The growing population led to massive logging of the forests around the city. By the mid-15th century, the forests had largely disappeared. As a substitute, residents turned to coal, which was first mined in the Western Hills during the Yuan dynasty and expanded in the Ming. The use of coal caused many environmental problems and changed the ecological system around the city.