 int checkPath(int n, int a, int b){
   return (
           //If We are using the AND Gate
-          ((n == 1 && (a == 1) && (b == 1))) ? 1 : 0) ||
+          ((n == 1 && ((a == 1) && (b == 1))) ? 1 : 0) ||
           //If we are using the OR Gate
           ((n == 2 && ((a == 1) || (b == 1))) ? 1 : 0) ||
           //If we are using NAND Gate

          //If we are using XNOR Gate
          ((n == 6 && !((a == 1) ^ (b == 1))) ? 1 : 0)
        );
}
void loop(){

  //Get data from the serial port (If any Available)
  /*if(Serial.available()){
    serialBytes = Serial.available();
    Serial.readBytes(serialIn, serialBytes);
    if((serialIn[1] == '|' && serialIn[3] == '|' && serialIn[5] == '|' && serialIn[7] == '|')){
