The Yungang Grottoes are located 16 km west of Datong and comprise about 53 caves and 51,000 statues. The site stretches about 1 kilometer from east to west and was hollowed from the sandstone cliffs of the Wuzhou Mountains during the 5th century CE under the patronage of the Northern Wei dynasty. Founded by the Tuoba or Toba people, who ruled northern China during the Northern and Southern Dynasties period (310-589 CE), the Wei dynasty adopted Buddhism as its state religion. Work was begun at Yungang by the emperor Wenchengdi (reigned 452-465). The caves range in width from 23 m to a few metres. In 494, the Wei moved their capital from Datong to Luoyang and the Yungang Grottoes slowly fell into decay. The Grottoes have been a UNESCO World Heritage site since 2001. The earliest caves (16-20, ca. 460-465) are named after the monk-official Tanyao. In one of the earliest written Chinese references to Buddhism, the Wei shu ('History of the Wei', compiled in the Northern Qi period (550'77)), records Tanyao's suggestion for the construction of five cave chapels, each containing a colossal image of the Buddha. The early caves feature static icons in a Gandharan (Indian) style.