Made the orange detection and viewport optional