added functoriality