The original code is outdated and there are now simpler, better ways of reporting which lights are on (several examples have already been presented and more can be found here and here). So unless you only want to use old-fashioned techniques, I suggest you consider using the most efficient modern ways of achieving your goal.
1 Like