     for(int i =0; i <depth; i++)
     {
         myKey[i] =   (aIndex+depth*tid + i < partitionSizeA ? A_keys  [myStartIdxA + aIndex+depth*tid+i] : MAX_VAL);
-        myValue[i] = (aIndex+depth*tid + i < partitionSizeA ? A_values[myStartIdxA + aIndex+depth*tid+i] : MAX_VAL);
+        myValue[i] = (aIndex+depth*tid + i < partitionSizeA ? A_values[myStartIdxA + aIndex+depth*tid+i] : UMAX_VAL);
     }
 
     if(bIndex + INTERSECT_B_BLOCK_SIZE_simple < sizePerPartition) {


	T MAX_VAL = getMax<T>();
	T MIN_VAL = getMin<T>();
    __shared__ T BKeys[INTERSECT_B_BLOCK_SIZE_simple+2];	
    T* BMax = (T*) &BKeys[INTERSECT_B_BLOCK_SIZE_simple];			
    T localMaxB, localMaxA, localMinB;					

    for(int i =0; i <depth; i++)
    {
        myKey[i] = (localAIndex+ i   < localAPartSize ? A_keys[myStartIdxA + localAIndex+i]   : MAX_VAL);
        myVal[i] = (localAIndex + i   < localAPartSize ? A_vals[myStartIdxA + localAIndex+i]   : UMAX_VAL);
    }
    
        
