added code for photo resistor