The earliest tribal civilizations were bonded together by mutual needs and beliefs. These groups were ruled by a tribal chieftain, who acted as an advisor, and enforcer of the will of the gods. No formal laws existed in these early cultures, but fear of the gods and a sense of tribal customs and morality kept order in the tribe. As societies became larger and more diverse, the need arose for established rules of conduct. The earliest known codes of laws existed in Babylon, India, and Palestine. The Twelve Tables of Rome written in 500 BC, and its successors such as the Justinian Code, were the first codes of law to distinguish between public law, which involves the state, and private law, which concerns disputed between citizens. Roman law was the first formalized written system of laws, and went on to influence many of the legal systems of the modern world.