move is_pair up in file