simulation script corrected