Monte Carlo simulation of polymer welding