change the declaration of the refract function