 }
 
 //Whether pulse length value matches specified constant with specified threshold
-boolean match(int value, int mathConst, int treshold) {
-    return value > mathConst - treshold && value < mathConst + treshold;
+boolean match(int value, int mathConst, int threshold) {
+    return value > mathConst - threshold && value < mathConst + threshold;
 }
 
 //set state to new value but only when condition is true


    if ((data[5] & 1) == 1) {
        //negative number, use two's compliment conversion
        temperature = ~temperature + 1;

        //clear higher bits
        temperature = temperature & 4095;
    }

    return temperature;
