nomenclature, rewritten third solution to be more comprehensible