Calculation of distance includes last til first node