corrected simulator settings
Tidy up of code