         Wire.begin();
     Wire.beginTransmission(addr);
     Wire.write(data);
-    if(Wire.endTransmission())
+    if(Wire.endTransmission() != 0) {
         return error();
+    }
     return 0; //returns 0 if sent successfully
 }
 

    Serial.begin(9600);
    //send(0, test, 6);
    delay(100);
    if(!initialize())
        Serial.println("Initialization Failed");
    threshold = massFSR();

}


int massChange(int initMass) {
    return massFSR()-initMass;
}
