     DateTime cur = parseHeader(ip, 80, WEBSITE, WEBPAGE);
     cur = cur + TimeSpan(0, TZOFFSET, 0, 0);
     rtc.adjust(cur);
-  }
+  } 
 }
 
 void loop() {
   // put your main code here, to run repeatedly:
   now = rtc.now();
   DU.update(lcd, rtc, cc3000);
+  // check alarms
+  uint8_t i;
+  for (i = 0; i < NALARMS; i++) {
+    if (alarms[i].set.unixtime() <= now.unixtime() && 
+        alarms[i].active) {
+      // pound the alarm
+      AS.PoundTheAlarm();
+      alarms[i].sounding = true;
+    }
+  }
+  // do UI stuff
+  if (!digitalRead(KEY_CANCEL)) {
+    Serial.print("Cancelled!");
+    // cancel the alarm
+    for (i = 0; i < NALARMS; i++) {
+      if (alarms[i].sounding) {
+        AS.KillTheAlarm();
+        alarms[i].sounding = false;
+        alarms[i].active = false;
+      }
+    }
+  }
 }

};

DisplayUpdater DU;

void setup() {
  // serial debug connection

  pinMode(RELAY1, OUTPUT);
  pinMode(RELAY2, OUTPUT);
  pinMode(RELAY4, OUTPUT);
  pinMode(KEY_CANCEL, INPUT_PULLUP);
  pinMode(KEY_DOWN, INPUT_PULLUP);
  pinMode(KEY_UP, INPUT_PULLUP);
  pinMode(KEY_OK, INPUT_PULLUP);
  // put your setup code here, to run once:
  Serial.println(F("\nInitialising the LCD ..."));
  lcd.begin(20,4);
