Update Simulation R code