## 2 Results and Discussion
### Thermal Studies on Compounds L-Zr-X  
During the heat-induced carbonization of STY-DVB copolymers--with or without functionalization with functional groups--a part of the carbon content turns into volatile compounds such as hydrocarbons and the cracking products of the functional groups [6; 9]. The imniodiacetate group is expected to be cracked into fragments of the CH\({}_{2}\)N(CH\({}_{2}\)COOH)\({}_{2}\) group, including H\({}_{2}\)O (from dehydration) or CO\({}_{2}\) (from decarboxylation) and various fragments containing N [31]. The evolution of H\({}_{2}\)O, CO\({}_{2}\), STY, DVB, some aromatic hydrocarbons, and the expected fragmentation products of the imniodiacetate group containing N is illustrated as a function of temperature (Figures 3 and 4 and Supplementary Materials, Figures S8-S10).  
The ratio of solid to volatile carbon compounds strongly depends on the decomposition temperature, heating rate, and DVB content and is influenced by the presence of metal ions and the extent of metal loading [6; 9]. Generally, the higher the metal or DVB content, the more solid carbon products are formed [6; 32; 33; 34]. Either the 2% DVB content or the incomplete saturation of functional groups by zirconium is a favorable condition for low solid carbon content in the decomposition products [5; 6], increasing the Zr/C ratio in the carbonized material. Therefore, first, we studied the mass loss ratio of volatiles (H\({}_{2}\)O, CO\({}_{2}\), and organic decomposition products)/solids (ZrC, ZrO\({}_{2}\) and carbon) at 800 and 1400 \({}^{\circ}\)C. The measured C/ZrO\({}_{2}\) ratios in the pre-pyrolyzed products of L-Zr-X samples formed at 800 \({}^{\circ}\)C (after eliminating all organic volatiles) were \(\sim\)5.8, \(\sim\)6.8 and 6.64 for X=Cl, N and S, respectively. Thus, the C/Zr ratio ensures that there is enough carbon content to form ZrC from ZrO\({}_{2}\)/C intermediates. The free carbon contents of the decomposition  
Figure 3: TG-MS curves for H\({}_{2}\)O and CO\({}_{2}\) evolution during decomposition of L-Zr-X samples.  
products formed at 1400 \({}^{\circ}\)with a 10 \({}^{\circ}\)C/min heating rate were \(\sim\)10, \(\sim\)5 and \(\sim\)45 mass% for the composites prepared from L-Zr-X resins (X=Cl, N and S), respectively.  
Figure 4: TG-MS decomposition curves of iminodiacetate group (**a**) and STY-DVB skeleton fragments, depolymerization products (**b**), and aromatics (**c**) of L-Zr-Cl sample.  
The thermal decomposition of the L-Zr-X samples (X=Cl, N and S) started similarly, by losing the swelling water and some adsorbed organic materials from the pores of the hydrophilic STY-DVB polymer network below 200 \({}^{\circ}\)C (Figure 3). The TG-MS curves first showed the elimination of water. Loss of the iminodiacetate functional groups occurred with the evolution of CO\({}_{2}\), H\({}_{2}\)O and CH\({}_{2}\)COO fragments (Figures 3 and 4, Supplementary Materials, Figures S8 and S9) at around \(\sim\)220 and \(\sim\)320 \({}^{\circ}\)C. Depolymerization first occurred around \(\sim\)320 \({}^{\circ}\)C, with the formation of STY and DVB. Complete cracking of the organic residues occurred with the formation of aromatic compounds between 400 and 500 \({}^{\circ}\)C. The TG-MS curves of decarboxylation, dehydration, depolymerization and cracking are given for L-Zr-X samples in Figure 4 and Supplementary Materials, Figures S8 and S9. The TG-DSC curves of the L-Zr-X systems are attached as Supplementary Materials, Figure S10.  
Water elimination, depolymerization and cracking are endothermic, whereas the decomposition of the iminodiacetate functional groups was exothermic for L-Zr-X (X=CL, N) samples. For X=S, all when the lower amount of Zr is adsorbed on the resin, all the reactions are endothermic (Supplementary Materials, Figure S8a-c). For X=N, zirconium carbide formed as an endothermic process, starting at 1180 and completed at 1321 \({}^{\circ}\)C.