reworked to use diode arrays