 {
   // begin serial communication and attach servos
   Serial.begin(9600);
-  for(int i = 0; i < 9; i++)
+  for(int i = 0; i < 9; i++) {
     servos[i].attach(pins[i]);
-
+    servo_pos[9] = (int)random(0,360);
+  }
 }
 
 void loop()
 {
-  
+  for(int i = 0; i < 9; i++) {
+    float servo_pos_rads = servo_pos[9]/180*3.1415926535
+    
+    double nextpos = (sin(servo_pos_rads) + 1)/2;
+    int lo = servo_low[i];
+    int hi = servo_high[i];
+    
+    int actualpos = lo + (int)(nextpos*(hi-lo));
+    servos[i].write(actualpos);
+    
+    servo_pos[i] = (servo_pos[i] + servo_vel[i]) % 360;
+  }
 }
 
 /* sweep_all - moves all servos up down to their low height 

  
  Serial.println("sweep of all servos complete");
}

/* sweep_servo - moves single servo down to lowest height
 * and back up to max height. works regardless of starting
 * position of the servo

int pins[] = {0};

/* high and low values platform corresponding to each servo */
int servo_low[] = {130, 140, 150, 4, 60, 143, 8, 154, 150};
int servo_high[] = {165, 175, 177, 25, 95, 170, 25, 177, 177};
int servo_pos[9];
int servo_vel[] = {5,1,2,6,3,7,2,3,4};

void sweep_all();
void sweep_servo(int servo_num);
