added more refraction related functions. still doesn't work though.