patches: added code to simulate (synthetize) patches