In 581 Yang Jian, outer kinsman of the Northern Zhou, received the abdication and founded the Sui, capital at Daxingcheng (Xi'an). In 589 he crossed the river, destroyed Chen, ended nearly three centuries of division and rebuilt unity. Emperor Wen set the germ of the three-departments-and-six-ministries system, opened the precedent of examination recruitment, issued the Kaihuang code and set relief granaries - under the Kaihuang order the population swelled. Emperor Yang built the eastern capital and cut the Tongji and other canals into the Grand Canal binding north and south, and created the jinshi degree; but three campaigns against Goguryeo and ceaseless touring drained the state, and risings multiplied from 611. In 618 Yang Guang died in the Jiangdu mutiny; Li Yuan proclaimed the Tang. The Sui fell - two emperors, thirty-eight years - its institutions largely inherited by Tang.