Have tried to fix nan. Added bool to calculate intersection for determining if it is a shadowray or not. Working on reflectRay so it looks a bit iffy