rule_C_triangle; fixed bug in expand_coeff; added tests and documentation