It works. However, it seems to be a logical error in the code. Read up on raytracing on the net plox