Simulation code and graphs
Minor changes.