The structure of firms