update simulation.R