   // Setup Serial connection
   Serial.begin(9600);
 
+  // Ethernet setup
+  ethernetSetup();
+
   // Initialize the rtc object
   rtc.begin();
   setCurrentTime(10, 0, 0);     // Set the time to 12:00:00 (24hr format)
 
   //set digital pins as outputs
-  pinMode(relay_1, OUTPUT);  
-  pinMode(relay_2, OUTPUT);  
-  pinMode(relay_3, OUTPUT);  
-  pinMode(relay_4, OUTPUT);
+  pinMode(relay_4, OUTPUT);  
+  pinMode(relay_5, OUTPUT);  
+  pinMode(relay_6, OUTPUT);  
+  pinMode(relay_7, OUTPUT);
   
   //-------( Initialize Pins so relays are inactive at reset)----
-  digitalWrite(relay_1, RELAY_OFF);
-  digitalWrite(relay_2, RELAY_OFF);
-  digitalWrite(relay_3, RELAY_OFF);
-  digitalWrite(relay_4, RELAY_OFF);  
+  digitalWrite(relay_4, RELAY_OFF);
+  digitalWrite(relay_5, RELAY_OFF);
+  digitalWrite(relay_6, RELAY_OFF);
+  digitalWrite(relay_7, RELAY_OFF);  
       
   delay(4000); //Check that all relays are inactive at 
 

void loop() {

  delay (2000);
  turnRelayOn(2, "relay");
  // Wait one second before repeating :)
  delay (1000);
  turnRelayOff(2, "relay");
  delay (2000);

//  t = rtc.getTimeStr();

  Serial.println(rtc.getTimeStr());

//  checkTemp(insideThermometer);
}

void checkTemp(DeviceAddress deviceAddress) {

  rtc.setTime(hours, minutes, seconds);
}

// Serve webpage
void serveWebpage() {
  // listen for incoming clients
  EthernetClient client = server.available();
  if (client) {
    Serial.println("new client");
    // an http request ends with a blank line
    boolean currentLineIsBlank = true;
    while (client.connected()) {
      if (client.available()) {
        char c = client.read();
        Serial.write(c);
        // if you've gotten to the end of the line (received a newline
        // character) and the line is blank, the http request has ended,
        // so you can send a reply
        if (c == '\n' && currentLineIsBlank) {
          // send a standard http response header
          client.println("HTTP/1.1 200 OK");
          client.println("Content-Type: text/html");
          client.println("Connection: close");  // the connection will be closed after completion of the response
          client.println("Refresh: 10");  // refresh the page automatically every 10 sec
          client.println();
          client.println("<!DOCTYPE HTML>");
          client.println("<html>");
          // Send the command to get temperatures
          sensors.requestTemperatures();
          // output the value of each analog input pin
          int sensorReading = digitalRead(9);
          client.print("<h1 style=\"color: #fff; background-color: #0000cc; padding: 10px; border-radius: 5px; font-family: Arial;\">Temperature is ");
          client.print(sensors.getTempCByIndex(0));
          client.print(" - just saying! </h1>");
          client.println("<br />");
          client.println("</html>");
          break;
        }
        if (c == '\n') {
          // you're starting a new line
          currentLineIsBlank = true;
        } else if (c != '\r') {
          // you've gotten a character on the current line
          currentLineIsBlank = false;
        }
      }
    }
    // give the web browser time to receive the data
    delay(1);
    // close the connection:
    client.stop();
    Serial.println("client disconnected");
  }
}
