A novel approach to the synthesis of CoPt magnetic nanoparticles