 }

  // Add a new node to the graph
  function addNode(label, category = "relevant_concepts") {
    // Check if node already exists
    if (nodes.find(n => n.id === label)) {
      console.log(`Node ${label} already exists`);
      return;
    }

    // Add to nodes array
    const newNode = {
      id: label,
      label: label,
      category: category,
      x: (width / 2),
      y: (height / 2),
    };

    nodes.push(newNode);

    // Update the simulation
    updateVisualization();

    // Return the