added sim_b.R