def get_smallest_entry(visited, distance):
    """ Returns the position of the unvisited node with the smallest
    distance. Returns None if no options are left. """
    smallest = None
    smallest_entry = None

    for i in range(0, len(visited)):
        if not visited[i] and distance[i] is not None:
            if distance[i] < smallest or smallest is None:
                smallest_entry = i
                smallest = distance[i]

    return smallest_entry