The role of phosphorus and bromine in flame retardancy