added refractive index control