   }
   while (repeat);
 }
-
-String floatToString(float number, int precision)
-{
-  String stringNumber = "";
-  //int prec;
-  //only temperature (case 1) has a decimal place
-  //if (sampleType == 1) prec = 1; else prec = 0;
-  char tempChar[10];
-  dtostrf(number, 3, precision, tempChar);
-  stringNumber += tempChar;
-  return stringNumber;
-}
-
-int calcUvIndex(int analogVal){
- // get voltage from analog value
- float uvindex = map(analogVal, 0, 1023, 0, 5000);
- uvindex /= 1000;
- //illumination intensity => V_sig * 307
- uvindex = uvindex * 307;
- //UVI => illumination intesity / 200
- uvindex = uvindex / 200;
- 
- return int(uvindex+0.5);
-}
    client.println("Content-Type: application/json"); 
    client.println("Connection: close");  
    client.print("Content-Length: "); 
    client.println(jsonData.length()); 
    client.println(); 
    client.print(jsonData); 
    client.println(); 
  } 
  waitForResponse();
  switchSampleType();
}

void switchSampleType(){
if (sampleType == phenomCount) sampleType = 1;
    else sampleType++;
}

void waitForResponse()

  // if there are incoming bytes available 
  // from the server, read them and print them: 
  boolean repeat = true; 
  do{ 
    if (client.available()) 
    { 
      char c = client.read();
