.removeChild(a);
        window.URL.revokeObjectURL(url);
    }

    // Modify download functions to ensure projectData exists
    function downloadSummary() {
        ensureProjectData();  // Create projectData if needed
        const blob = new Blob([projectData.toString()], {type: 'text/plain'});
        const url = URL.createObjectURL(blob);
        const a = document.createElement('a');
        a.href = url;
        a.download = 'goldenpond-project.txt';
        document.body.appendChild(a);
        a.