implement diffraction in buildGi