Tried to fix the refraction bug. I think I'm going at things backwards.