Added turnedOn and turnedOff variables.