reworked SDPairs.cc