The theory of a firm