distributive law and factorization of product over sum; improved documentation