Monte Carlo raytracer in c++