improved method of addComponents