     int maux = clawpatch_opt->maux;
     int meqn = clawpatch_opt->meqn;  
 
-    /* ---------------------------------- Merge Memory ---------------------------------*/ 
     cudaclaw_fluxes_t* fluxes = &(array_fluxes_struct[0]);
     size_t size = batch_size*(fluxes->num + fluxes->num_aux);
     size_t bytes = size*sizeof(double);
     double *membuffer;
-    //double *membuffer = FCLAW_ALLOC(double,size);
-    CHECK(cudaMallocHost((void**)&membuffer,bytes));
+    double* membuffer_dev;
 
-    double* membuffer_dev;
-    CHECK(cudaMalloc((void**)&membuffer_dev, bytes));
+    /* ---------------------------------- Merge Memory ---------------------------------*/ 
+    {
+        PROFILE_CUDA_GROUP("cudaclaw_copy_loop",7);    
+        CHECK(cudaMallocHost((void**)&membuffer,bytes));
 
-    for(i = 0; i < batch_size; i++)   
-    {
-        cudaclaw_fluxes_t* fluxes = &(array_fluxes_struct[i]);    
+        CHECK(cudaMalloc((void**)&membuffer_dev, bytes));
 
-        int I_q = i*fluxes->num;
-        int I_aux = batch_size*fluxes->num + i*fluxes->num_aux;
+        for(i = 0; i < batch_size; i++)   
+        {
+            cudaclaw_fluxes_t* fluxes = &(array_fluxes_struct[i]);    
 
-        memcpy(&membuffer[I_q]  ,fluxes->qold ,fluxes->num_bytes);
-        memcpy(&membuffer[I_aux],fluxes->aux  ,fluxes->num_bytes_aux);
+            int I_q = i*fluxes->num;
+            int I_aux = batch_size*fluxes->num + i*fluxes->num_aux;
 
-        /* Assign gpu pointers */
-        fluxes->qold_dev = &membuffer_dev[I_q];
-        fluxes->aux_dev  = &membuffer_dev[I_aux];
+            memcpy(&membuffer[I_q]  ,fluxes->qold ,fluxes->num_bytes);
+            memcpy(&membuffer[I_aux],fluxes->aux  ,fluxes->num_bytes_aux);
+
+            /* Assign gpu pointers */
+            fluxes->qold_dev = &membuffer_dev[I_q];
+            fluxes->aux_dev  = &membuffer_dev[I_aux];
+        }        
+
+        CHECK(cudaMemcpy(membuffer_dev, membuffer, bytes, cudaMemcpyHostToDevice));
     }        
-
-    CHECK(cudaMemcpy(membuffer_dev, membuffer, bytes, cudaMemcpyHostToDevice));
 
     /* -------------------------------- Work with array --------------------------------*/ 
 

    CHECK(cudaMemcpy(membuffer, membuffer_dev, batch_size*fluxes->num_bytes, 
                     cudaMemcpyDeviceToHost));

    for (int i = 0; i < batch_size; ++i)    
    {      
        cudaclaw_fluxes_t* fluxes = &(array_fluxes_struct[i]);
        int I_q = i*fluxes->num;

        memcpy(fluxes->qold,&membuffer[I_q],fluxes->num_bytes);
    }

    /* ------------------------------ Clean up -----------------------------------------*/ 
    cudaFree(array_fluxes_struct_dev);
    cudaFree(membuffer_dev);
    cudaFreeHost(membuffer);
    //FCLAW_FREE(membuffer);

    return maxcfl;
}

	
    /* -------------------------------- Finish CFL ------------------------------------*/ 
    {
        PROFILE_CUDA_GROUP("Finish CFL",1);
        void    *temp_storage_dev = NULL;
        size_t  temp_storage_bytes = 0;
        double  *cflgrid_dev;
