             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;
+        for(int imp = 0; imp < 2; imp++)
+        {
+            for(int m = 0; m < maux; m++)
+            {
+                int I_aux = I + m*zs;
+                int 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)];


        rpt2(0,meqn,mwaves,maux,ql,qr,aux1,aux2,aux3,1,apdq,bmasdq,bpasdq);

        for(mq = 0; mq < meqn; mq++)
        {
            I_q = I + mq*zs;  
            gupdate = 0.5*dtdx*bpasdq[mq];
            gm[I_q + ys] -= gupdate;
            gp[I_q + ys] -= gupdate;
        }

    if (order[1] == 0)
    {
        /* No transverse propagation; Update the solution and exit */
        for(int thread_index = threadIdx.x; thread_index < mx*my; thread_index += blockDim.x)
        {
            int ix = thread_index % mx;
            int iy = thread_index/mx;

            int I = (ix + mbc) + (iy + mbc)*ys;

            for(int mq = 0; mq < meqn; mq++)
            {
                int I_q = I + mq*zs;
                qold[I_q] = qold[I_q] - dtdx * (fm[I_q + 1] - fp[I_q]) 
                                      - dtdy * (gm[I_q + ys] - gp[I_q]);
            }        
