Simulation script is now working + other minor improvements.