   lcd.setCursor(0, 3);
   lcd.print("GAS  ");
   lcd.print(g);
+  //LCD print out end here
 }
-
-
-
-void funShowResult()
+//Function for Reading Sensor value end here
+////////////////////////////////////////////////
+
+///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+//Showing FUZZY results on LCD
+void funShowFuzzyResult()
 {
   lcd.clear();
   switch (stemperature)
   {
     case 1: lcd.setCursor(0, 0); lcd.print("Temperature is Very Cold"); lcd.setCursor(0, 1); lcd.print("Fuzzy 1"); break;
-    case 2: lcd.setCursor(0, 0); lcd.print("Temperature is Cold"); lcd.setCursor(0, 1); lcd.print("Fuzzy 2"); break; break;
-    case 3: lcd.setCursor(0, 0); lcd.print("Temperature is Normal"); lcd.setCursor(0, 1); lcd.print("Fuzzy 3"); break; break;
-    case 4: lcd.setCursor(0, 0); lcd.print("Temperature is Hot"); lcd.setCursor(0, 1); lcd.print("Fuzzy 4"); break; break;
-    case 5: lcd.setCursor(0, 0); lcd.print("Temperature is Very Hot"); lcd.setCursor(0, 1); lcd.print("Fuzzy 5"); break; break;
+    case 2: lcd.setCursor(0, 0); lcd.print("Temperature is Cold");      lcd.setCursor(0, 1); lcd.print("Fuzzy 2"); break; break;
+    case 3: lcd.setCursor(0, 0); lcd.print("Temperature is Normal");    lcd.setCursor(0, 1); lcd.print("Fuzzy 3"); break; break;
+    case 4: lcd.setCursor(0, 0); lcd.print("Temperature is Hot");       lcd.setCursor(0, 1); lcd.print("Fuzzy 4"); break; break;
+    case 5: lcd.setCursor(0, 0); lcd.print("Temperature is Very Hot");  lcd.setCursor(0, 1); lcd.print("Fuzzy 5"); break; break;
   }
   switch (shumidity)
   {
-    case 1: lcd.setCursor(0, 2); lcd.print("Humidity is Very Humid"); lcd.setCursor(0, 3); lcd.print("Fuzzy 1"); break;
-    case 2: lcd.setCursor(0, 2); lcd.print("Humidity is Humid"); lcd.setCursor(0, 3); lcd.print("Fuzzy 2"); break; break;
-    case 3: lcd.setCursor(0, 2); lcd.print("Humidity is Normal"); lcd.setCursor(0, 3); lcd.print("Fuzzy 3"); break; break;
-    case 4: lcd.setCursor(0, 2); lcd.print("Humidity is Dry"); lcd.setCursor(0, 3); lcd.print("Fuzzy 4"); break; break;
-    case 5: lcd.setCursor(0, 2); lcd.print("Humidity is Very Dry"); lcd.setCursor(0, 3); lcd.print("Fuzzy 5"); break; break;
+    case 1: lcd.setCursor(0, 2); lcd.print("Humidity is Very Humid");   lcd.setCursor(0, 3); lcd.print("Fuzzy 1"); break;
+    case 2: lcd.setCursor(0, 2); lcd.print("Humidity is Humid");        lcd.setCursor(0, 3); lcd.print("Fuzzy 2"); break; break;
+    case 3: lcd.setCursor(0, 2); lcd.print("Humidity is Normal");       lcd.setCursor(0, 3); lcd.print("Fuzzy 3"); break; break;
+    case 4: lcd.setCursor(0, 2); lcd.print("Humidity is Dry");          lcd.setCursor(0, 3); lcd.print("Fuzzy 4"); break; break;
+    case 5: lcd.setCursor(0, 2); lcd.print("Humidity is Very Dry");     lcd.setCursor(0, 3); lcd.print("Fuzzy 5"); break; break;
   }
   funBuzzerLed();
   delay(5000);
-
 }
-
+//function End here
+//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+
+//function for buzzer on led on
 void funBuzzerLed()
 {
   digitalWrite(led1, HIGH);

    if (hflag[1] == 3)
    {
      shumidity = 2;
      funShowResult();
    }
  }
  else if ((H >= 40) && (H < 50))

#define IRreceiver 2
#define Buzzer 11
#define led1 8
#define Relay1 10
#define Relay2 9

//Config values
static int maxgas=200;
static int mingas= 20;


//flags and key parameters
static int sgas = 0;
static int stemperature = 3; // 1-very cold <10  2-cold <20  3-normal 20-30 4-hot 30-35 5-very hot >35
static int shumidity = 3; //  1-very humid >60  2-humid 50-60 3-normal 40-50 4-dry 40-30 5-very dry <30
static int tflag[5] = {0, 0, 0, 0, 0}; //flag =3 trigger
static int hflag[5] = {0, 0, 0, 0, 0}; //flag =3 trigger
static int status = 1;
static int show = 0;

//creating dht and blueooth objects
dht DHT;
SoftwareSerial BlueTooth(6, 7);       //TXD11  RXD12


//creating structure for dht22
struct
{
  uint32_t total;
