cleaning up simulation code
cleaning up the simulation script