Change find_pair logic to handle MISSING values better