closest pairs advanced -I