made major changes to raytracer and functions