what is the purpose of laws