                     if (reference_bp != read_bp)
                     {
                         ctx.cigar.is_snp[idx.read_start + current_bp_idx] = 1;
-                        num_snps++;
+                        num_errors++;
                     }
                 }
 
                 break;
 
             case cigar_event::I:
-                // update the current read bp index
-                current_bp_idx = ctx.cigar.cigar_event_read_coordinates[i];
-                ctx.cigar.is_insertion[idx.read_start + current_bp_idx] = 1;
+                // mark the read bp where an insertion begins
+                current_bp_idx = ctx.cigar.cigar_event_read_coordinates[cigar_start];
+
+                if (!negative_strand)
+                {
+                    ctx.cigar.is_insertion[idx.read_start + current_bp_idx] = 1;
+                } else {
+                    ctx.cigar.is_insertion[idx.read_start + current_bp_idx + batch.cigars[event].len - 1] = 1;
+                }
+
+                num_errors++;
                 break;
 
             case cigar_event::D:
                 // note: deletions do not exist in the read, so current_bp_idx is not updated here
-                // this marks the read bp where a deletion begins
-                // (this implies that a given bp can have both is_deletion and one of is_insertion or is_snp set)
-                ctx.cigar.is_deletion[idx.read_start + current_bp_idx] = 1;
+                // mark the read bp where a deletion begins
+                if (!negative_strand)
+                {
+                    ctx.cigar.is_deletion[idx.read_start + current_bp_idx] = 1;
+                } else {
+                    ctx.cigar.is_deletion[idx.read_start + current_bp_idx + 1] = 1;
+                }
+
+                num_errors++;
                 break;
             }
         }
 
-        ctx.cigar.num_errors[read_index] = num_snps;
-    }
-};
-
-struct count_indels : public bqsr_lambda
-{
-    count_indels(bqsr_context::view ctx,
-                 const alignment_batch_device::const_view batch)
-        : bqsr_lambda(ctx, batch)
-    { }
-
-    CUDA_HOST_DEVICE void operator() (const uint32 read_index)
-    {
-        const CRQ_index idx = batch.crq_index(read_index);
-        const uint32 cigar_start = ctx.cigar.cigar_offsets[idx.cigar_start];
-        const uint32 cigar_end = ctx.cigar.cigar_offsets[idx.cigar_start + idx.cigar_len];
-
-        uint32 sum = 0;
-        for(uint32 i = cigar_start; i < cigar_end; i++)
-        {
-            if (ctx.cigar.cigar_events[i] == cigar_event::I ||
-                ctx.cigar.cigar_events[i] == cigar_event::D)
-            {
-                sum++;
-            }
-        }
-
-        ctx.cigar.num_errors[read_index] += sum;
+        ctx.cigar.num_errors[read_index] = num_errors;
     }
 };
 

        const uint32 reference_alignment_start = seq_base + align_offset;

        uint16 current_bp_idx = 0;
        uint16 num_snps = 0;

        // go through the cigar events looking for the event we're interested in
        for(uint32 i = cigar_start; i < cigar_end; i++)
        {
            switch(ctx.cigar.cigar_events[i])
            {
            case cigar_event::M:
                {
                    // update the current read bp index
                    current_bp_idx = ctx.cigar.cigar_event_read_coordinates[i];

                     cigar_coordinates_expand(*context, batch.device));

    // compute the error bit vectors
    // this also counts the number of errors in each read
    thrust::for_each(context->active_read_list.begin(),
                     context->active_read_list.end(),
                     compute_error_vectors(*context, batch.device));
}

void debug_cigar(bqsr_context *context, const alignment_batch& batch, int read_index)
