The effect of mass loss on the chemical yields from massive stars