 
 // maximum read size for the lmem kernel
 #define LMEM_MAX_READ_LEN 151
-#define LMEM_MAT_SIZE ((LMEM_MAX_READ_LEN + 1) * 3 * (2 * MAX_BAND_WIDTH + 1))
+#define LMEM_MAT_ROW_SIZE (3 * MAX_BAND_WIDTH2 + 6)
+#define LMEM_MAT_SIZE ((LMEM_MAX_READ_LEN + 1) * LMEM_MAT_ROW_SIZE)
+
+//#define GUARD_BAND(z) ((z) > 0 ? (z) : 0)
+#define GUARD_BAND(z) (z)
 
 template <target_system system>
 struct compute_hmm_windows : public lambda<system>

#define EI 0.25

#define MAX_BAND_WIDTH 7
#define MIN_BASE_QUAL 4

// all bases with q < minBaseQual are up'd to this value

    // computes a matrix offset for forwardMatrix or backwardMatrix
    CUDA_HOST_DEVICE int off(int i, int j = 0)
    {
        return i * LMEM_MAT_ROW_SIZE + j;
    }

    // computes the required HMM matrix size for the given read length
    CUDA_HOST_DEVICE static uint32 matrix_size(const uint32 read_len)
    {
        return (read_len + 1) * LMEM_MAT_ROW_SIZE;
    }

    CUDA_HOST_DEVICE static double qual2prob(uint8 q)
