     
     */              
 
-    for(thread_index = threadIdx.x; thread_index < num_ifaces; thread_index += blockDim.x)
+    for(int thread_index = threadIdx.x; thread_index < num_ifaces; thread_index += blockDim.x)
     { 
-        ix = thread_index % ifaces_x;
-        iy = thread_index/ifaces_x;
-
-        I =  (iy + mbc-1)*ys + (ix + mbc);  /* (ix,iy) = (0,0) maps to first non-ghost value */
-
-        for(mq = 0; mq < meqn; mq++)
-        {
-            I_q = I + mq*zs;
+        int ix = thread_index % ifaces_x;
+        int iy = thread_index/ifaces_x;
+
+        int I =  (iy + mbc-1)*ys + (ix + mbc);  /* (ix,iy) = (0,0) maps to first non-ghost value */
+
+        for(int mq = 0; mq < meqn; mq++)
+        {
+            int I_q = I + mq*zs;
 
             ql[mq] = qold[I_q-1];
             qr[mq] = qold[I_q];

            apdq[mq] = apdq_trans[I_q];
        }            

        for(imp = 0; imp < 2; imp++)
        {
            for(m = 0; m < maux; m++)
            {
                I_aux = I + m*zs;
                k = imp*maux + m;
                aux1[k] = aux[I_aux - ys + (imp - 1)];
                aux2[k] = aux[I_aux      + (imp - 1)];
                aux3[k] = aux[I_aux + ys + (imp - 1)];

    double cqyy;
    double gupdate;
    int imp;
#endif    


    /* --------------------------------- Start code ----------------------------------- */

    __shared__ double dtdx, dtdy;
    __shared__ int xs,ys,zs;
    if (threadIdx.x == 0)
    {
        dtdx = dt/dx;
