Simulation and math script