Fixed the problem whereby all pairs in every single block were being compared by specifying whether each pair was a row or column type. Appears to work properly.