reformatted code to submit one script per sample id