fixing raytracer trace()