def get_path_array(node):
    """
    Takes an end node and gives you every node (in order) for the shortest path to it.

    PARAMS:
        node (node): end node

    RETURNS:
        array[nodes]: every note you need to visit (in order)
    """
    if node.shortest_path_via == None:
        return [node]
    else:
        return get_path_array(node.shortest_path_via) + [node]