Diffraction grating problem