Code for the lights tutorial