Zhang Yan traveled to Datang and assisted Li Er in establishing Datang He also helped Li Er launch the Xuanwu Gate Change and ascended to the throne Goryeo in the east Turks in the north Nanzhao in the south Tubo in the west Establishing imperial examinations suppressing gate valves repairing