       } else {
         state2 = false;
       }
-      digitalWrite(led2, state2);
+      digitalWrite(relay2, state2);
     }
   }
 }

      } else {
        state1 = false;
      }
      digitalWrite(led1, state1);
    } else if (incomingByte == '2') {
      Serial.println("Toggling light 2");
      if (state2 == false){


void setup() {
  Serial.begin(9600);
  pinMode(relay1, OUTPUT);
  pinMode(relay2, OUTPUT);
}

void loop() {
