Xiao's adviser Shang Yang implemented a legal code in Qin based on the Canon of Laws which established punishment for complicity in a crime, established a system of military ranks, and implemented policies encouraging the cultivation of unsettled land.