Code for simulation buildup and analysis