The federal government had controlled the price of natural gas that crossed state lines, but not of gas produced and sold within a state. In the 1970s, the low interstate price set by the federal government caused supply shortages of gas in consuming states, because gas producers sold as much as they could of their product for higher prices in the local markets within gas-producing states. In the Natural Gas Policy Act of 1978, the federal government extended price controls to all natural gas in the country. At the same time, the government created a complex price system in which the price paid to the producer depended on the date the well was drilled, the depth of the well, the geological formation, the distance to other gas wells, and several other factors. The price system was an attempt to keep the average price low while encouraging new production.