Code for nighlight LSR program