The Chinese philosophy of Confucius (551–479 BC) and the hierarchical social order his disciples adhered to had become embedded into mainstream Chinese culture since the reign of Emperor Wu of Han (r. 141–87 BC). During the Song dynasty, the entire Chinese society was theoretically modelled upon this familial social order of superiors and inferiors. Confucian dogma dictated what was proper moral behavior, and how a superior should regulate rewards or punishments when dealing with an inferior member of society or one's family. This is exemplified in the Tang law code, which was largely retained in the Song period. Gernet writes: "The family relationships supposed to exist in the ideal family were the foundation of the entire moral outlook, and even the law, in its total structure and its scale of penalties, was nothing but a codified expression of them."