cofactor expansions