working version, no simulations run