modified sim_single.Rmd