2 servos glitching 2 MPU6050

Hi, I'm working on a project and found some code that is the frame work for what I need. I altered it to what I need but am having some problems. Before I started altering the code It worked ok but the servos still glitched a little bit. Now they freak out all over the place. My goal is to have 2 MPU6050 sensors controlling 2 different servos. the code is attached. Please help!

#include "I2Cdev.h"

#include "MPU6050_6Axis_MotionApps20.h"

#if I2CDEV_IMPLEMENTATION == I2CDEV_ARDUINO_WIRE
    #include "Wire.h"
#endif

#include <Servo.h>

Servo myservo1;
Servo myservo2;

MPU6050 mpu1(0x68);  // ADO low 
MPU6050 mpu2(0x69);  // ADO high 

#define OUTPUT_READABLE_YAWPITCHROLL


#define LED_PIN 13
bool blinkState = false;
bool attInt = false;

// New Stuff 
long unsigned currentTime = 0;
long unsigned counter = 0;
boolean flip = true;




// MPU control and status vars 
bool dmpReady1 = false;  // set true if DMP init was successful
uint8_t mpuIntStatus1;   // holds actual interrupt status byte from MPU
uint8_t devStatus1;      // return status after each device operation (0 = success, !0 = error)
uint16_t packetSize1;    // expected DMP packet size (default is 42 bytes)
uint16_t fifoCount1;     // count of all bytes currently in FIFO
uint8_t fifoBuffer1[64]; // FIFO storage buffer
bool dmpReady2 = false;  // set true if DMP init was successful
uint8_t mpuIntStatus2;   // holds actual interrupt status byte from MPU
uint8_t devStatus2;      // return status after each device operation (0 = success, !0 = error)
uint16_t packetSize2;    // expected DMP packet size (default is 42 bytes)
uint16_t fifoCount2;     // count of all bytes currently in FIFO
uint8_t fifoBuffer2[64]; // FIFO storage buffer

// orientation and motion vars 
Quaternion q1;           // [w, x, y, z]         quaternion container
VectorInt16 aa1;         // [x, y, z]            accel sensor measurements
VectorInt16 aaReal1;     // [x, y, z]            gravity-free accel sensor measurements
VectorInt16 aaWorld1;    // [x, y, z]            world-frame accel sensor measurements
VectorFloat gravity1;    // [x, y, z]            gravity vector
float euler1[3];         // [psi, theta, phi]    Euler angle container
float ypr1[3];           // [yaw, pitch, roll]   yaw/pitch/roll container and gravity vector
Quaternion q2;           // [w, x, y, z]         quaternion container
VectorInt16 aa2;         // [x, y, z]            accel sensor measurements
VectorInt16 aaReal2;     // [x, y, z]            gravity-free accel sensor measurements
VectorInt16 aaWorld2;    // [x, y, z]            world-frame accel sensor measurements
VectorFloat gravity2;    // [x, y, z]            gravity vector
float euler2[3];         // [psi, theta, phi]    Euler angle container
float ypr2[3];           // [yaw, pitch, roll]   yaw/pitch/roll container and gravity vector



// INTURREUPT DETECTION 
volatile bool mpuInterrupt1 = false;     // indicates whether MPU interrupt pin has gone high
volatile bool mpuInterrupt2 = false;     // indicates whether MPU interrupt pin has gone high
void dmpDataReady1() {
    mpuInterrupt1 = true;
}

void dmpDataReady2() {
    mpuInterrupt2 = true;
}


void setup() {

   myservo1.attach (8);
   myservo2.attach (9);
  

   #if I2CDEV_IMPLEMENTATION == I2CDEV_ARDUINO_WIRE
        Wire.begin();
        Wire.setClock(400000); // 400kHz I2C clock. Comment this line if having compilation difficulties
    #elif I2CDEV_IMPLEMENTATION == I2CDEV_BUILTIN_FASTWIRE
        Fastwire::setup(400, true);
    #endif
    

TWBR = 24; // 400kHz I2C clock (200kHz if CPU is 8MHz)

Serial.begin(115200);

    while (!Serial); // wait for Leonardo enumeration, others continue immediately

    // initialize device
    Serial.println(F("Initializing I2C devices..."));
    mpu1.initialize();
    mpu2.initialize();


// verify connection
    Serial.println("Testing device connections...");
    Serial.println(mpu1.testConnection() ? F("MPU6050-1 connection successful") : F("MPU6050-1 connection failed"));
    Serial.println(mpu1.testConnection() ? F("MPU6050-2 connection successful") : F("MPU6050-2 connection failed"));

 // wait for ready
    Serial.println(F("\nSend any character to begin DMP programming and demo: "));
    while (Serial.available() && Serial.read()); // empty buffer
    while (!Serial.available());                 // wait for data
    while (Serial.available() && Serial.read()); // empty buffer again


    // load and configure the DMP
    Serial.println(F("Initializing DMP..."));
    devStatus1 = mpu1.dmpInitialize();
    devStatus2 = mpu2.dmpInitialize();

    // supply your own gyro offsets here, scaled for min sensitivity
    mpu1.setXGyroOffset(220);
    mpu1.setYGyroOffset(76);
    mpu1.setZGyroOffset(-85);
    mpu1.setZAccelOffset(1788); 
    mpu2.setXGyroOffset(220);
    mpu2.setYGyroOffset(76);
    mpu2.setZGyroOffset(-85);
    mpu2.setZAccelOffset(1788); 

    // make sure it worked (returns 0 if so)
    if (devStatus1 == 0 && devStatus2 == 0) {
        // Turn on both devices
        Serial.println(F("Enabling DMP..."));
        mpu1.setDMPEnabled(true);
        mpu2.setDMPEnabled(true); 

        // enable interrupt detection
        Serial.println(F("Enabling interrupt detection (Arduino external interrupt 0)..."));
      attachInterrupt(0, dmpDataReady1, RISING); 
      attachInterrupt(1, dmpDataReady2, RISING); 
        mpuIntStatus1 = mpu1.getIntStatus();           
        mpuIntStatus2 = mpu2.getIntStatus();   

        // set DMP Ready 
        Serial.println(F("DMP ready! Waiting for first interrupt..."));
        dmpReady1 = true;
        dmpReady2 = true;
        
        // get expected DMP packet size for later comparison
        packetSize1 = mpu2.dmpGetFIFOPacketSize();        
        packetSize2 = mpu2.dmpGetFIFOPacketSize(); 
            } else {
        // ERROR!
        // 1 = initial memory load failed
        // 2 = DMP configuration updates failed
        // (if it's going to break, usually the code will be 1)
        Serial.print(F("DMP Initialization failed (code "));
        Serial.print(devStatus1);
        Serial.print("\t");
        Serial.print(devStatus2);
        Serial.println(F(")"));
    }

   
  pinMode(LED_PIN, OUTPUT);
}

first half

void loop() {

    
 
    // if failed
    if (!dmpReady1 || !dmpReady2 ) return;

       // wait for MPU interrupt
   while (!mpuInterrupt1 && fifoCount1 < packetSize1 && !mpuInterrupt2 && fifoCount2 < packetSize2) {
        // other program behavior stuff here
        // .
        // .
        // .
        // if you are really paranoid you can frequently test in between other
        // stuff to see if mpuInterrupt is true, and if so, "break;" from the
        // while() loop to immediately process the MPU data
        // .
        // .
        // .
    }

    mpuInterrupt1 = false;     // indicates whether MPU interrupt pin has gone high
    mpuInterrupt2 = false;     // indicates whether MPU interrupt pin has gone high
    mpuIntStatus1 = mpu1.getIntStatus();
    mpuIntStatus2 = mpu2.getIntStatus();    

    fifoCount1 = mpu1.getFIFOCount();
    fifoCount2 = mpu2.getFIFOCount();

    // check for FIFO overflow 
    if ((mpuIntStatus1 & 0x10) || fifoCount1 == 1024) {
        // reset so we can continue cleanly
        mpu1.resetFIFO();
        Serial.println(F("Malfunction"));

    // else check for DMP data ready interrupt
    } else if (mpuIntStatus1 & 0x02) {
        // wait for corrrect data length
        while (fifoCount1 < packetSize1) fifoCount1 = mpu1.getFIFOCount();

        // read a packet from FIFO
        mpu1.getFIFOBytes(fifoBuffer1, packetSize1);
        
        // track FIFO count here in case there is > 1 packet available bypassing interrupt
        fifoCount1 -= packetSize1;

             #ifdef OUTPUT_READABLE_YAWPITCHROLL
            // display Euler angles in degrees
            mpu1.dmpGetQuaternion(&q1, fifoBuffer1);
            mpu1.dmpGetGravity(&gravity1, &q1);
            mpu1.dmpGetYawPitchRoll(ypr1, &q1, &gravity1);
            Serial.print("ypr1\t");
            Serial.print(ypr1[0] * 180/M_PI);
            Serial.print("\t");
            Serial.print(ypr1[1] * 180/M_PI);
            myservo1.write(ypr1[1] * 180/M_PI);    
            Serial.print("\t");
            Serial.println(ypr1[2] * 180/M_PI);
        #endif
    }
    
    if ((mpuIntStatus2 & 0x10) || fifoCount2 == 1024) {
        // reset so we can continue cleanly
        mpu2.resetFIFO();
        Serial.println(F("Malfunction on 2"));

    // else check for DMP data ready interrupt
    } else if (mpuIntStatus2 & 0x02) {
        // wait for correct available leangth
        while (fifoCount2 < packetSize2) fifoCount2 = mpu2.getFIFOCount();

        // read a packet from FIFO
        mpu2.getFIFOBytes(fifoBuffer2, packetSize2);
        
        // track FIFO count here in case there is > 1 packet available bypassing interrupt
        fifoCount2 -= packetSize2;

            // angles in degrees
            mpu2.dmpGetQuaternion(&q2, fifoBuffer2);
            mpu2.dmpGetGravity(&gravity2, &q2);
            mpu2.dmpGetYawPitchRoll(ypr2, &q2, &gravity2);
            Serial.print("ypr2\t");
            Serial.print(ypr2[0] * 180/M_PI);
            Serial.print("\t");
            Serial.print(ypr2[1] * 180/M_PI);
            myservo2.write(ypr2[1] * 180/M_PI); 
            Serial.print("\t");
            Serial.println(ypr2[2] * 180/M_PI);
    }
   

// blink LED to indicate activity
blinkState = !blinkState;
digitalWrite(LED_PIN, blinkState);
}

second half