 //Buffer for json parsing
 //Could potentially take up too much memory
 DynamicJsonBuffer jsonBuffer;
-bool updated = false;
+boolean updated = false;
 
 //For smoothing of data
-bool prevBackData[10] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
-bool prevLeftData[10] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
-bool prevRightData[10] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
+boolean prevBackData[10] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
+boolean prevLeftData[10] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
+boolean prevRightData[10] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
 
 int counter = 0;
 

  } else {
    rightArm = false;
  }



  //build JSON string
  jsonString = "{\"type\":\"";
  jsonString += type;
  jsonString += "\",\"name\":\"";
  jsonString += name;
  jsonString += "\",\"leftArm\":\"";
  
  jsonString += leftArm;
  jsonString += "\",\"rightArm\":\"";
  jsonString += rightArm;
  jsonString += "\",\"back\":\"";
  jsonString += back;
  jsonString += "\"}";

  //Print JSON to Serial if different
  if (oldJSON != jsonString){
    Serial.println(jsonString);
    oldJSON = jsonString;
  }
}

    back = backBentBack();
  }

  if (counter < 9){
    counter++;
  } else {
    counter = 0;
  }

  Serial.print(rightArm);

  //add new data to the arrays
  prevBackData[counter] = back;
  prevLeftData[counter] = leftArm;
  prevRightData[counter] = rightArm;

  prevBackCount = 0;
  prevLeftCount = 0;
  prevRightCount = 0;

  //collect # right
  for (int i = 0; i < 9; i++){
    if (prevBackData[i] == true){
      prevBackCount++;
    }
    if (prevLeftData[i] == true){
      prevLeftCount++;
    }
    if (prevRightData[i] == true){
      prevRightCount++;
    }
  }
