added handling for when ray origin is inside sphere