 #include <SPI.h>
 #include <GSM.h>
 #include <HttpClient.h>
+#include <Time.h>
 #include <Xively.h>
+#include <FreeMemory.h>
 
 //============================================================
 // IMPORTANT!

  // loseSomeTime can only sleep for up to just over a minute (65535
  // milliseconds) so to get decent sleep intervals, we'll loop through
  // a number of times
  for (int i =0; i < kReportInterval; i++) {
    lastReportTime = millis();
    while (Sleepy::loseSomeTime((60*1000)-(millis()-lastReportTime)) == 0)
    {
      // It was interrupted by the movement trigger, go back to sleep
#if 0
      digitalWrite(4, HIGH);
      delay(300);
      digitalWrite(4, LOW);
#endif
    }
  }

  digitalWrite(13, LOW);
  delay(1000);
  digitalWrite(13, HIGH);
  
  if (movementCount > lastMovementCount)
  {
    int diff = movementCount - lastMovementCount;

      delay(200);
    }
  }
#if DEBUG
  Serial.println("finished putting data");
#endif

  while ( gsmAccess.shutdown() != 1 ) {
    delay (1000);
