    cat <<EOF
 @@ -148,16 +167,12 @@
  Usage: $command [options] <command>
-
+ 
  $command gzip *.img *.hdr
 -$command -q short.q gzip *.img *.hdr
  $command -a darwin regscript rawdata outputdir ...
-
+ 
    -T <minutes>          Estimated job length in minutes, used to auto-set queue name
 -  -q <queuename>        Possible values for <queuename> are "verylong.q", "long.q" 
 -                        and "short.q". See below for details
 -                        Default is "long.q".
 -  -a <arch-name>        Architecture [e.g., darwin or lx24-amd64]
 +  -a <arch-name>        Architecture [e.g., darwin (not Legion) or lx24-amd64]
-   -p <job-priority>     Lower priority [0:-1024] default = 0
+   -p <job-priority>     Lower priority [0:-1024] default = 0                 
 -  -M <email-address>    Who to email, default = `whoami`@fmrib.ox.ac.uk 
 +  -M <email-address>    Who to email, default = `whoami`@ucl.ac.uk 
    -j <jid>              Place a hold on this task until job jid has completed

 defopts="--cnonlinear"
 opts="$opts $defopts $other"
-if [ -n "$SGE_ROOT" ]; then
-       # Look for an SGE queue
-       if [ -n "$FSLGECUDAQ" -a "$nocuda" -eq 0 ]; then
-               # Test that the queue exists
-               qconf -sq $FSLGECUDAQ 2>&1 >/dev/null
-               if [ $? -eq 0 ]; then
-                       # CUDA queue exists
-                       if [ -x $0_gpu ]; then
-                               exec $0_gpu $myopts
-                       fi
-               fi
-       fi
-fi
+
+# Commented out on legion - no user queues
+#
+#if [ -n "$SGE_ROOT" ]; then
+#      # Look for an SGE queue
+#      if [ -n "$FSLGECUDAQ" -a "$nocuda" -eq 0 ]; then
+#              # Test that the queue exists
+#              qconf -sq $FSLGECUDAQ 2>&1 >/dev/null
+#              if [ $? -eq 0 ]; then
+#                      # CUDA queue exists
+#                      if [ -x $0_gpu ]; then
+#                              exec $0_gpu $myopts
+#                      fi
+#              fi
+#      fi
+#fi

 echo subjectdir is $subjdir

@@ -262,9 +271,9 @@
 mkdir -p ${subjdir}.bedpostX/logs/monitor
 mkdir -p ${subjdir}.bedpostX/xfms

-mailto=`whoami`@fmrib.ox.ac.uk
+mailto=`whoami`@ucl.ac.uk      # updated for UCL
 echo Queuing preprocessing stages
-preprocid=`${FSLDIR}/bin/fsl_sub -T 60 -m as -N bpx_preproc -l ${subjdir}.bedpostX/logs ${FSLDIR}/bin/bedpostx_preproc.sh ${subjdir} ${gflag}`
+preprocid=`${FSLDIR}/bin/fsl_sub -T ${wallclock} -m as -N bpx_preproc -l ${subjdir}.bedpostX/logs ${FSLDIR}/bin/bedpostx_preproc.sh ${subjdir} ${gflag}`

 echo Queuing parallel processing stage
 nslices=`${FSLDIR}/bin/fslval ${subjdir}/data dim3`
@@ -293,10 +302,10 @@

+                        smp for Legion.
                         <threads> specifies the number of threads to run
   -v                    Verbose mode.
 
-Queues:
-
-There are several batch queues configured on the cluster, each with defined CPU
