Simulation of Reaction Pathways for On-Surface Polymerization