disable KeyboardInterrupt while performing simulations so they don't get into an inconsistent state
use c++11 foreach syntax