pairing functions