       servo1.write(pos);
       servo2.write(pos-90); 
       servo3.write(140);
-//      servo2.write(legPos);
       legPos -= 1;
 
       delay(15);
-      servo2.write(legPos);
-
-
-      
+      servo2.write(legPos);      
   }
     for (pos = 145; pos >= 125; pos -= 1) { // goes from 180 degrees to 0 degrees
       servo1.write(pos);              // tell servo to go to position in variable 'pos'

      if (commands[i] == "sword"){
        startTime = millis();
        Serial.print("wagao");
        while (millis() < startTime + duration*1000) {
          swordFight(arm1,arm2,legs);      
        }
      command = "";
    }
        
      } else if (commands[i] == "walk") {
          startTime = millis();
          Serial.print("wagao");
          while (millis() < startTime + duration*1000) {
           walk(arm1,arm2,legs);      
          }
          command = "";
        } else if (commands[i] == "bow") {

      }
    }


//    command = "";
//  }
//  
}


void walk(Servo servo1, Servo servo2, Servo servo3) {
