   } else {
     if(debug == true) {Serial.println("nothing from Master Bluetooth.");}
   }
-  bt.flush();
+  //bt.flush();
+  bt.end();
 }
 
 void readOBD()
 {
-  if(debug == true) {Serial.println("reading OBD Bluetooth...");}
   if (obd.available() > 0) {
+    if(debug == true) {Serial.println("reading OBD Bluetooth...");}
     String msg; // string to store entire command line
     delay(1000); // wait 1 sec to give time enough for the serial to receive all the stream
     while (obd.available()) {

// Bluetooth Serial parameters:
SoftwareSerial bt(5,4);
char btt = '0';
char srl = '0';

// TinyGPS parameters:
static const int RXPin = 2, TXPin = 3;

  delay(1000);
}

void sendMaster(String msg)
{
  bt.begin(9600);
  bt.flush();
  if(debug == true) {Serial.print("sending Bluetooth message: "); Serial.println(msg);}
  bt.println(msg);
  bt.end();
}

void readMaster()
{
  bt.begin(9600);
  if (bt.available() > 0) {
    String msg; // string to store entire command line
    if(debug == true) {Serial.println("reading Master Bluetooth...");}
    while (bt.available()) {
      str = bt.read();
      msg += str;
    }
    Serial.println(msg);
    delay(50);
