During the Qing dynasty, criminal justice was based on an extremely detailed criminal code. One element of the traditional Chinese criminal justice system is the notion that criminal law has a moral purpose, one of which is to get the convicted to repent and see the error of his ways. In the traditional Chinese legal system, a person could not be convicted of a crime unless they confessed. This often led to the use of torture, in order to extract the necessary confession. These elements still influence modern Chinese views toward law. All death sentences were reported to the capital and required the personal approval of the emperor.