public int findNodeWithHighestScore(int node) {
        int highestScore = 0;
        int nextNode = 0;
        boolean found = false;
        for (List<Integer> list : graph) {
            if (list.get(1) == node) {
                int score = list.get(2);
                if (score > highestScore) {
                    highestScore = score;
                    nextNode = list.get(0);
                    found = true;
                }
            }
        }

        if (found) {
            return nextNode;
        } else {
            return -1;
        }

    }