 
     // write out the outputs
     chain_ranges[ chain_id ]  = range;
-    chain_weights[ chain_id ] = weight;
+    chain_weights[ chain_id ] = uint64( weight ) | (uint64( read ) << 32);
 }
 
 // filter the chains belonging to each read

    for (uint32 i = begin + 1; i < end; ++i)
    {
        const uint2  i_span = chain_ranges[ chain_index[i] ];
        const uint32 i_w    = chain_weights[ chain_index[i] ];

        uint32 j;
        for (j = begin; j < begin + n; ++j)
        {
            const uint2  j_span = chain_ranges[ chain_index[j] ];
            const uint32 j_w    = chain_weights[ chain_index[j] ];

            const uint32 max_begin = nvbio::max( i_span.x, j_span.x );
            const uint32 min_end   = nvbio::min( i_span.y, j_span.y );

        nvbio::hi_bits_functor<uint32,uint64>() );

    nvbio::vector<device_tag,uint2>  chain_ranges( n_chains );
    nvbio::vector<device_tag,uint64> chain_weights( n_chains );
    nvbio::vector<device_tag,uint32> chain_index( reserved_space ); // potentially a little bigger because we'll reuse
                                                                    // it for the final filtering...

