Updated to allow SGE submissison- problem with TMP and with R1 R2 variables