Add pairing algorithm