         Serial.print("From BT: ");
         Serial.println((char *)recv_str);
 
-        blueToothSerial.print("Return: ");
+        blueToothSerial.print("Arduino: ");
         blueToothSerial.println((char *)recv_str);
+
+        handleCommand();
     }
 
 }


void setup() 
{ 
    // user PIN 9 for AT mode
    pinMode(9, OUTPUT);
    digitalWrite(9, HIGH);
  
    Serial.begin(9600);   //Serial port for debugging
    pinMode(RxD, INPUT);    //UART pin for Bluetooth

    }

    return i;
}

// handles the command received from BT
void handleCommand()
{
    int state = digitalRead(Handler);
    if(state == HIGH)
    {
        digitalWrite(Handler, LOW);
    }
    else
    {
        digitalWrite(Handler, HIGH);
    }
}

//configure the Bluetooth through AT commands
