   }
 }
 
+
+/**
+ * connects to a web server and parses its HTTP Date: header to get the current DateTime
+ */
 DateTime parseHeader(uint32_t ip, uint16_t port, char *host, char *path) {
+  #define LINELEN 256
+  /**
+   * holds the HTTP Date header line, which fortunately has fixed with fields
+   * Date: Tue 15 Nov 1994 08:12:31 GMT
+   */
+  typedef union dateline
+  {
+    char line[LINELEN];
+    struct fields {
+      char date[6];
+      char dow[4]; char pad; 
+      char dom[3]; char mmm[4]; char yyyy[5];
+      char hh[3]; char mm[3]; char ss[3];
+      char tz[4];
+    } fields;
+  } dateline;
+
   // first connect to the site we're gonna leech the datetime from
   Adafruit_CC3000_Client www = cc3000.connectTCP(ip, port);
   if (www.connected()) {

  }
  www.close();
  if (wehaveadate) {
    // please fucking refactor this shit
    // this is the fucking worst way to parse shit
    // TODO: refactor this into an union or something less fucking terrible
    line[10] = 0; // null after dow
    line[13] = 0; // null after dom
    line[17] = 0; // null after month
    line[22] = 0; // null after year
    line[25] = 0; // null after hour
    line[28] = 0; // null after minute
    line[31] = 0; // null after second
    char *s_year = line+18;
    char *s_month = line+14;
    char *s_day = line+11;
    char *s_hour = line+23;
    char *s_minute = line+26;
    char *s_second = line+29;
    return DateTime(atoi(s_year), parseMonth(s_month), atoi(s_day), atoi(s_hour), atoi(s_minute), atoi(s_second));    
  } else {
    return NULL;
  }


DateTime now = DateTime(0);

/**
 * converts a three letter english abbreviation for a month into the months number
 */
uint8_t parseMonth (char *mo) {
  if (!strcmp(mo, "Jan")) {
    return 1;
