found an issue with nearest.dist