The technology of the Song Dynasty (960–1279 AD) was advanced, providing some of the most prolific technological advancements in Chinese history, much of which came from talented statesmen drafted by the government through imperial examinations. The ingenuity of mechanical engineering had a long tradition in China. The Song Dynasty engineer Su Song admitted that he and his contemporaries were building upon the achievements of the ancients such as Zhang Heng, an astronomer, inventor, and early master of mechanical gears. The application of movable type printing advanced the already widespread use of woodblock printing to educate and amuse Confucian students and the masses. The application of new weapons employing the use of gunpowder enabled the Song Dynasty to ward off its militant enemies until its collapse to the Mongol forces of Kublai Khan, in the late 13th century. Notable advancements in civil engineering, nautics, and metallurgy were made in Song China, as well as the introduction of the windmill to China during the 13th century. These advancements, along with the introduction of paper-printed money, helped revolutionize and sustain the economy of the Song Dynasty.