             gupdate = 0.5*dtdx*bpasdq[mq];
             gm[I_q - 1 + ys] -= gupdate;
             gp[I_q - 1 + ys] -= gupdate;
-        }
-        
-        __threadfence_block();
-
+        }        
+    }
+
+
+    __syncthreads();
+
+    ifaces_x = mx + 1;  /* Visit x - edges of all non-ghost cells */
+    ifaces_y = my + 2;
+    num_ifaces = ifaces_x*ifaces_y;
+
+    for(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;
+
+            ql[mq] = qold[I_q-1];
+            qr[mq] = qold[I_q];
+
+            amdq[mq] = amdq_trans[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)];
+            }
+        }
 
         /*     transverse-x
     
                 |     |     | 
                 |     |     | 
-            ----|-----|--O--|-----
-                |     X--^  | 
+            ----|-----|-----|-----
+                |     X     | 
                 |     X  q  |
                 |     X--v  |
-            ----|-----|--O--|-----
+            ----|-----|--0--|-----
                 |     |     |
                 |     |     |
     
         */              
-
         rpt2(0,meqn,mwaves,maux,ql,qr,aux1,aux2,aux3,1,apdq,bmasdq,bpasdq);
 
         for(mq = 0; mq < meqn; mq++)

        for(thread_index = threadIdx.x; thread_index < mx*my; thread_index += blockDim.x)
        {
            ix = thread_index % mx;
            iy = thread_index/my;

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


                }   
            }  
        }  
        __syncthreads();
    }  /* Done with second order corrections */


