     ctx->alignment_windows.resize(batch.reads.size());
     thrust::for_each(ctx->read_order.begin(),
                      ctx->read_order.end(),
+    // set up the alignment window buffer
+    ctx->alignment_windows.resize(batch.crq_index.size());
                      compute_alignment_window(*ctx, batch));
 }
 

        : bqsr_lambda(ctx, batch)
    { }

    NVBIO_HOST_DEVICE void operator() (const uint32 read_id)
    {
        const uint32 read_index = ctx.read_order[read_id];
        const BAM_CRQ_index& idx = batch.crq_index[read_index];

        const BAM_cigar_op *cigar = &batch.cigars[idx.cigar_start];

    }

public:
    NVBIO_HOST_DEVICE void operator() (const uint32 read_index)
    {
        const BAM_CRQ_index& idx = batch.crq_index[read_index];
        const uint2& alignment_window = ctx.alignment_windows[read_index];
        const uint16 *offset_list = &ctx.snp_filter.read_offset_list[read_index];
