implemented selection of paths (really closest point to the click)