modified simulation script