         else
             bandWidth = queryLen;
 
-        if (MAX_BAND_WIDTH < abs(referenceLength - queryLen))
+        if (MIN_BAND_WIDTH < abs(referenceLength - queryLen))
         {
             bandWidth = abs(referenceLength - queryLen) + 3;
         }
 
-        if (bandWidth > MAX_BAND_WIDTH)
-            bandWidth = MAX_BAND_WIDTH;
+        if (bandWidth > MIN_BAND_WIDTH)
+            bandWidth = MIN_BAND_WIDTH;
 
         if (bandWidth < abs(referenceLength - queryLen))
         {

//        fprintf(stderr, "read %d: _iqual = { % 3d % 3d % 3d % 3d % 3d ... % 3d % 3d % 3d % 3d % 3d }\n", read_index,
//                inputQualities[0], inputQualities[1], inputQualities[2], inputQualities[3], inputQualities[4],
//                inputQualities[queryLen - 5], inputQualities[queryLen - 4], inputQualities[queryLen - 3], inputQualities[queryLen - 2], inputQualities[queryLen - 1]);
//        fprintf(stderr, "read %d: c->bw = %d, bw = %d, l_ref = %d, l_query = %d\n", read_index, MAX_BAND_WIDTH, bandWidth, referenceLength, queryLen);

        /*** forward ***/
        // f[0]


// maximum read size for the lmem kernel
#define LMEM_MAX_READ_LEN 151
#define LMEM_MAT_ROW_SIZE (3 * MIN_BAND_WIDTH2 + 6)
#define LMEM_MAT_SIZE ((LMEM_MAX_READ_LEN + 1) * LMEM_MAT_ROW_SIZE)

//#define GUARD_BAND(z) ((z) > 0 ? (z) : 0)
