Synthesis and characterization of heteroatom containing polymers and their metal complexes nanocomposites