def orderPath (nodesDict, start, stop, path):
    """
    Internal function used by shortestWay to
    put into order nodes from the routing table.
    Return the shortest path from start to stop
    """
    if start == stop:
        return path + [start]

    return orderPath (nodesDict, start, nodesDict[stop][0], path + [stop])