pi: follow min distance working