Synthesis of nanoclusters and nanoparticles