Remove the
word "boolean" on line 6 of your second code block. You're redefining "light" rather than referencing the value you defined earlier. Also, just a friendly suggestion, if the intent is to not leave the light on indefinitely once it's been turned on, modify your logic so that if your action command is not "light on", set light=false.