pairwiseLD speed improvement