pairing algorithm work-in-progress