I don't know what's going on here.  Waiting for clarification.
Some typos and cleanup.
Refrain from matching an unlit lamp when only a lit one is available and vice versa.