technologies are generally described for a system and method effective to prepare a flame retardant . in one example , a method may include copolymerizing a mixture of monomers . the mixture of monomers may include at least one dicarboxylic acid monomer , at least one diamine monomer , and at least one monomer having the formula wherein r1 is hydroxyl , halogen , alkoxy , or aryloxy ; wherein r2 is hydroxyl , halogen , alkoxy , or aryloxy ; wherein r3 is h or - l - r5 ; wherein r4 is h or l - r5 ; wherein if r3 is h , then r4 is l - r5 ; wherein l is alkyl , cycloalkyl , aryl , heteroaryl , or — n -; wherein r6 is alkyl , cycloalkyl , aryl , or heteroaryl , wherein r7 is alkyl , cycloalkyl , aryl , or heteroaryl , wherein n is an integer from 1 to 12 ; wherein r5 is a flame retarding moiety comprising p , n , halogen , or b ; and wherein q is an integer from 1 to 12 .