                                 malformed_read_filter,
                                 context->temp_storage);
 
-    // resize temp_u32 and copy back into active_read_list
-    temp_u32.resize(num_active);
-    active_read_list = temp_u32;
+    // apply the malformed cigar filters, copying from temp_u32 into active_read_list
+    num_active = nvbio::copy_if(num_active,
+                                temp_u32.begin(),
+                                active_read_list.begin(),
+                                malformed_cigar_filter,
+                                context->temp_storage);
+
+    // resize active_read_list
+    active_read_list.resize(num_active);
 
     context->stats.filtered_reads += start_count - num_active;
 }

            return false;
        }

        // CIGAR contains N operators
        // (GATK: checkCigarIsSupported)
        for(uint32 i = idx.cigar_start; i < idx.cigar_start + idx.cigar_len; i++)
        {
            if (batch.cigars[i].op == BAM_cigar_op::OP_N)
            {
                return false;
            }
        }


    filter_mapq mapq_filter(*context, batch);
    // corresponds to the GATK filter MalformedReadFilter
    filter_malformed_reads malformed_read_filter(*context, batch);
    filter_malformed_cigars malformed_cigar_filter(*context, batch);

    start_count = active_read_list.size();

