         cudaDeviceSynchronize();
 
         /* -------------------------- Compute CFL --------------------------------------*/ 
-        int n = (2*mbc+mx)*(2*mbc+my)*mwaves*2;
-        int maxidx;
-        double maxabsspeed;
+        n = (2*mbc+mx)*(2*mbc+my)*mwaves*2;
+        dtdx = dt/dx;
+        dtdy = dt/dy;
+
 
         cublasStatus_t stat;
         cublasHandle_t handle;



    /* -------------------------- Update solution --------------------------------------*/ 
    double dtdx, dtdy;
    dtdx = dt/dx;
    dtdy = dt/dy;

    cudaEventRecord(start);

    dim3 block(32,32);  

                return EXIT_FAILURE;
        }
        cudaMemcpy(&maxabsspeed,fluxes->speeds_dev+maxidx-1,sizeof(double),cudaMemcpyDeviceToHost);
	    cflgrid = maxidx < n/2 ? maxabsspeed*dt/dx : maxabsspeed*dt/dy;
        cublasDestroy(handle);

        cudaEventRecord(stop);
