added simulations code