Branching in epoxy resins: molecular weight as a function of the extent of reaction and critical behaviour