for changing index of refraction