fix a subtle bug in induce_pairwise_reordering.py