The evolution of the molecular structure of polypyrrole during chemical polymerization