What is the Purpose of Law?

Law is actually very necessary in general life. Laws are there to protect the innocent and punish the guilty. For example, if no laws existed, someone could murder a person and get away with it. With law, there is justice.