changed the MainSimulator function