Implemented refraction