       lcd.setCursor(0,1); 
       lcd.print("         OFF!     "); 
       setColor(0,0,0); 
-      digitalWrite(RELAYpin,LOW); 
     }
     delay(900); 
-    if(lastON){
-      r++; r%=2; 
-    }
-  }
-  lastON=digitalRead(RELAYbutton); 
-
+  }
+  
   
   if(digitalRead(PIRsensorPin)){ // motion sense 
     if(DEBUG) Serial.println("Somebody is in this area!"); 

}

int alarm=0,lightBulb=0; 
int lastON=0,r=0; 
unsigned long WIFIupload = -REFRESHupload ,LASTmotion = 0; 

void loop()
{  
  
  if(DEBUG) Serial.print("Gas value is "); 
  if(DEBUG) Serial.println(analogRead(GASpin)); 


      strncpy_P(buffer+strlen(buffer), PSTR("&light="), sizeof(buffer)-strlen(buffer)-1);
      ltoa(analogRead(PHOTOpin), buffer+strlen(buffer), 10); 

      strncpy_P(buffer+strlen(buffer), PSTR("&ms="), sizeof(buffer)-strlen(buffer)-1);
      ltoa(millis()/1000, buffer+strlen(buffer), 10); 
