     int warpidx = threadIdx.x >> 5;
     int tid = threadIdx.x & 31;
 
-//     __shared__ int s_out_all[256 * WARPS_NUM];
-// 
-//     uint4 * s_out  =  s_out_all + warpidx * 256;
+    __shared__ uint4 s_out_all[64 * WARPS_NUM];
+    unsigned int * s_out = (unsigned int*)(s_out_all + warpidx * 64);
+    
+    // Number of remaining codewords in shared buffer
+    int remaining_codewords = 0;
     
     // Select Segment
     int segment_index = blockIdx.x * WARPS_NUM + warpidx;

    ((uint2*)data_compressed)[tid] = codewords;
    
    // advance the pointer
    data_compressed += (32 * sizeof(uint2)) / sizeof(*data_compressed);
    
    // nothing to fail here
    return 0;

        dc[comp] = 0;
    
    // Prepare data pointers
    unsigned int * data_compressed = (unsigned int*)(d_data_compressed + segment->data_compressed_index);
    unsigned int * data_compressed_start = data_compressed;
    
    // Non-interleaving mode
    if ( comp_count == 1 ) {
