added both simple and optical detectors