Spectroscopic study of impurities in the JFT-2 tokamak