bugfixes
added refraction support