Throughout the history of criminal justice, evolving forms of punishment, added rights for offenders and victims, and policing reforms have reflected changing customs, political ideals, and economic conditions. Background Primates often have notions of fairness and sharing, with violations punished by exclusion or banishment from social groups. In human history, prior to agriculture, more nomadic cultures had systems of punishment for behavior or resistance. With the development of agriculture, which led to more closely populated cities and cultures and behavior to address fears of persons taking advantage of or causing harm to others, more formal systems of punishment for crimes developed, independently around the world, or based upon other cultures, including those developed in the early Babylonian laws of Hammurabi and the Hammurabic Code. Medieval Middle East A police force called the shurta was "an urban force for the suppression of crime" that originated as a branch of the military. They were responsible for dealing with brigands and allegedly rebels as well as exercising judicial functions (often in rivalry with the qadi). The muhtasib was responsible for enforcing laws on markets, Islamic morality and sumptuary laws for dhimmis. Ancient Egypt In Ancient Egypt a police force was created by the time of the Fifth Dynasty (25th – 24th century BC). The guards, chosen by kings and nobles from among the military and ex-military, were tasked with apprehending criminals and protecting caravans, public places and border forts before the creation of a standing army. The police used lethal and non-lethal tools (such as wooden staffs) and utilized monkeys and dogs. During the reign of Amenemhat I (1991 BC – 1962 BC) the role of professional judges were established and employed to decide court cases. The police force was specifically focused on law enforcement, while a newly created standing military was utilized to fulfill the police's other, previous tasks. Ancient China Law enforcement in Ancient China was carried out by "prefects". The notion of a "prefect" in China has existed for thousands of years. The prefecture system developed in both the Chu and Jin kingdoms of the Spring and Autumn period. In Jin, dozens of prefects were spread across the state, each having a limited authority and employment period. In Ancient China, under the rule of Dang Lin Wang, a new judicial system emerged. This new system had prefects appointed by local magistrates, who in turn were appointed by the head of