Create find min distance