Selecting the close curve within two curves