code after simulations