       if (data[0] >> 3 == id){
         byte kom = data[0] & B00000111;
         
-        if (kom == B101)
+        if (kom == comSet)
         {
           byte dataType =  data[1];
           int value = data[2];


          handleDataChange(dataType, value);

          byte header = createHeader(B110);
          byte confirmationMessage[4] = { header, data[1], data[2], data[3]};

          Serial.write(confirmationMessage, 4);
        }
        else if (kom == B100)
        {
          byte header = createHeader(B111);
          byte pingback[4] = { header, productID[0], productID[1], productID[2] };

          Serial.write(pingback, 4);

  return header;
}

void returnValue(byte dataID)
{
  short value;
  
  if (dataID == 0x1)
  {
    value = ledValue;
  }
  
  byte header = createHeader(comReturn);
  byte returnMessage[4] = { header, dataID, (byte)(value >> 8), (byte)value };

  Serial.write(returnMessage, 4);
}

void handleDataChange(byte dataType, int value) {
  if (dataType == 1){
    ledValue = value == 0 ? LOW : HIGH;
    digitalWrite(ledPin, ledValue);
  }
}

