   Serial.begin(9600); //begin serial communications
   ServoGripper.attach(GripPin); //Declare the Servo to be Connected to GripPin
   pinMode(StimPin, OUTPUT); // Set TENS output to StimPin
-  pinMode(SwitchPin, INPUT);      // sets the digital pin 4 as the switch input
-  pinMode(SwitchThreshold, INPUT);      // sets the digital pin 7 as the threshold changer
   for(int i = 0; i < NUM_LED; i++){ //initialize LEDs as outputs
     pinMode(leds[i], OUTPUT);
   pinMode(aQ1, OUTPUT);
-  
+
   }
   MAX = MAX_High; //This sets the default to people with high EMG activity.
-  
-  
 }
 
 void loop(){
-    
-    //note the serial print stuff is sjust debugging tools
-    SwitchThresholdState = digitalRead(SwitchThreshold);
-    if (SwitchThresholdState == HIGH){ // This will allow the switching between a low threshold and high threshold state on S2
-    if (MAX == MAX_High){ MAX = MAX_Low; digitalWrite(aQ3, HIGH);}
-    else{
-     MAX = MAX_High; digitalWrite(aQ2, HIGH); } 
-    while (SwitchThresholdState == HIGH) { // This will pause the program while the person is touching the threshold button, 
-    SwitchThresholdState = digitalRead(SwitchThreshold);  
-    delay(10); }                         // so it doesn't flip back and forth while button is pushed
-    }
-
-    SwitchState = digitalRead(SwitchPin);
-    //Serial.println(SwitchState);
-    if (SwitchState == HIGH){ // This will activate the TENS if the PushButton is pressed on S1
-    digitalWrite(StimPin, HIGH), digitalWrite(aQ1, HIGH);
-    //Serial.println('Stim');
-     while (SwitchState == HIGH) { // This will pause the program while the person is touching TENS test button
-    SwitchState = digitalRead(SwitchPin);  
-    delay(10); }    
-    } 
-  
   for(int i = 0; i < 10; i++){    //take ten readings in ~0.02 seconds
     reading[i] = analogRead(A0) * multiplier;
     delay(2);

  }
  OldTime = millis();
  old_degrees = new_degrees;
}  
   //delay(10);
  //for serial debugging, uncomment the next two lines.
  //Serial.println(finalReading);
  //delay(100);
}
    

int reading[10];
int finalReading;
int StimPin = 3; // TENS Digital 3
int GripPin = 2; //Digital Out that controls Servo Motor Gripper Hand
int MAX = 0;
byte litLeds = 0;
byte multiplier = 1;
