adding the latest version of simulation script
fixed probable file read errors