 listener for chord sequence changes
        document.getElementById('chordSequence').addEventListener('input', updateChordNames);
        
        // Add change event listener for mode changes
        document.getElementById('mode').addEventListener('change', updateChordNames);

        console.log('All event listeners attached successfully');

        // Now that all DOM elements and event listeners are set up,
        // we can safely load the piece config
        setTimeout(() => {
            loadPiece