 int index = 0;
 int lastIndex = -1;
 int pinNumber = 0;
+
+unsigned char reprovisionAfter = 3;  // Number errors before reprovision attempt
+unsigned char errorCount = 3;        // Force Provision On First Loop
+
+char macString[18];  // Used to store a formatted version of the MAC
 
 /*==============================================================================
  * setup

// Fill in your MAC here! (e.g. {0x90, 0xA2, 0xDA, 0x00, 0x22, 0x33}) 
byte macData[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; 

//Fill in your CIK here! (https://portals.exosite.com -> Add Device)
char cikData[] = "0000000000000000000000000000000000000000";  

// Set the maximum interval we should read and write to Exosite.
unsigned long loop_interval_ms = 10000; // milliseconds

/*****************************************************************************/

#include <SPI.h>
#include <Ethernet.h>
#include <Exosite.h>


  Serial.print(F("Connecting to Exosite..."));

  if(exosite.writeRead(writeString, readString, returnString)){
    errorCount = 0;
    
    Serial.println(F("Success"));
    for(;;){
      index = returnString.indexOf("=", lastIndex+1);
