Grid();

      let isRunning = false;
      let animationId;

      canvas.addEventListener("click", handleCanvasClick);
      document
        .getElementById("startButton")
        .addEventListener("click", toggleSimulation);
      document
        .getElementById("clearButton")
        .addEventListener("click", clearGrid);

      function createEmptyGrid() {
        return new Array(rows)
          .fill(null)
          .map(() => new Array(cols).fill(false));
      }

      function