Raytracer implementation in Scala