Rework the pairs plotting script