Added new logic for the FlashSensor class.