A penal code can be defined as that portion of a state's laws that deal with defining the elements of particular crimes and specifying the punishment for each crime. Other parts of the laws of a given state can also define crimes and punishments, such as a traffic code or a building safety code, or laws addressing environmental resources by regulating hunting, fishing, or forestry.