Code to run interval simulations