finish cmb function