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

                      double t,
                      double dt)
{
    cudaEvent_t start, stop;
    cudaEventCreate(&start);
    cudaEventCreate(&stop);
    float milliseconds;
    
    fc2d_cudaclaw_vtable_t*  cuclaw_vt = fc2d_cudaclaw_vt();

    double *qold, *aux;
    int mx, my, meqn, maux, mbc;
    double xlower, ylower, dx,dy;
    double cflgrid;

    fc2d_cudaclaw_options_t* cuda_opt = fc2d_cudaclaw_get_options(glob);


        cudaDeviceSynchronize();

        /* -------------------------- Compute CFL --------------------------------------*/ 
        n = (2*mbc+mx)*(2*mbc+my)*mwaves*2;
        dtdx = dt/dx;
        dtdy = dt/dy;


        cublasStatus_t stat;
        cublasHandle_t handle;
