                          int16_t* predecessors)
 {
     uint16_t node_id = graph[max_score_id_pos];
+
+    // Go through all the outgoing edges of the node, and for
+    // each of the end nodes of the edges clear the scores
+    // for all the _other_ nodes that had edges to that end node.
     uint16_t out_edges = outgoing_edge_count[node_id];
     for(uint16_t oe = 0; oe < out_edges; oe++)
     {

            uint16_t id = incoming_edges[out_node_in_edges * CUDAPOA_MAX_NODE_EDGES + ie];
            if (id != node_id)
            {
                scores[node_id] = -1;
            }
        }
    }

    int32_t max_score = 0;
    uint16_t max_score_id = 0;
    for(uint16_t graph_pos = max_score_id_pos + 1; graph_pos < node_count; graph_pos++)
    {
        node_id = graph[graph_pos];
        predecessors[node_id] = -1;

        int32_t score_node_id = -1;

        uint16_t in_edges = incoming_edge_count[node_id];

            }
        }

        // Then update the score of the node to be the sum
        // of the score of the predecessor and itself.
        if (predecessors[node_id] != -1)
        {
            score_node_id += scores[predecessors[node_id]];
        }

        // Keep track of the highest weighted node.
        if (max_score < score_node_id)
        {
            max_score_id = node_id;
