changes to the processing code to select the value of photocell on top