Separated simulationplot function from main