Added raytracing algortihm