implement them. By 167 BC the law had changed so that castration was not used as a punishment itself; instead becoming an optional replacement for execution. Tang Code The Tang code saw the creation of what could be termed the first judiciary - mandarin officials who specialized in interpretation of law. Qualifications for this position required demonstration of the 3 Qis believed to produce a perfectly balanced individual: knowledge, demonstrated by study of legal scripture, wisdom and fairness demonstrated by many years of apprenticeship, and virility, demonstrated by physical fitness and sexual conquest. This process continued throughout the Han and later dynasties, culminating in the Tang dynasty. Ch'ü T'ung-tsu has shown that the "Confucianisation" of Chinese law was a slow process and that the amalgamation of the Confucian views of society with the law codes was completed only in the great Tang Code of CE 624. The code is regarded as a model of precision and clarity in terms of drafting and structure. The original Tang Code was promulgated in 624, by the founding Emperor (Gaozu) of the Tang dynasty. It would become in modern times the earliest fully preserved legal code in the history of Chinese law. It was endowed with a commentary, known as Tanglu Shuyi, incorporated in 653, the fourth year of the reign of Perpetual Splendour, as part of the Tang Code of Perpetual Splendour. The Tang Code was based on the Code of Northern Zhou (Bei Zhou Lu, 557–581), promulgated 89 years earlier in 564, which was in turn based on the earlier, less comprehensive and less elaborate Code of Cao Wei (Cao Wei Lu, 220–265) and the Code of Western Jin (Xi Jin Lu, 265–317) promulgated almost four centuries earlier in 268. Confucian attitudes place low reliance on law and punishment for maintaining social order. Evidence of this can be found in the Aspiration (Zhi) section of the 200-volume Old Book on Tang (Jiu Tang Shu), a magnum opus of Tang historiography. The history classic was compiled under official supervision in 945 during the Late Jin dynasty (Hou Jin, 936–946) of the era of Five Generations (Wudai, 907–960), some three centuries after the actual events. A single chapter on Punishment and Law (Xingfa) is placed last after seven chapters on Rites (Liyi), after which come four chapters on Music (Yinyue), three chapters on the Calendar (Li), two on Astronomy and Astrology (Tianwen), one on