   }
 
   if(angle > 0){
+    leftMotor.set(-leftSpeed);
+    rightMotor.set(rightSpeed);
+  }else{
     leftMotor.set(leftSpeed);
     rightMotor.set(-rightSpeed);
-  }else{
-    leftMotor.set(-leftSpeed);
-    rightMotor.set(rightSpeed);
   }
 
   while(abs(getGyroAngle() - gyroTargetAngle) > angleThreshold){
     Serial.println(String(getGyroAngle()));
-    delay(25);
+    delay(5);
   }
 
   stopRobot();

//adjusts the target angle based on how much we want to turn and turns the robot until that target is reached
//use turn(0) to simply get the gyro back on track if it's off target
void turn(int angle){
  gyroTargetAngle += angle;
  if(gyroTargetAngle >= 360){
    gyroTargetAngle = gyroTargetAngle - 360;

    FreqCount.begin(200); // Begin measuring sound
    checkMicrophone();  //robot stays in setup until frequency is heard

    turn(90);
  }
}

