Robotic Arm Project

I have finished an alike project----a 4-freedom arm, using joystick(made by 4 pots) to control it.
Servos as driving unit.
Here is another resourses:Endurance R/C - Analog Reader
Here is the code(just copy and paste):
#include <Servo.h>

Servo myservo1;
Servo myservo2;
Servo myservo3;
Servo myservo4;// create servo object to control a servo

int potpin1 = 0; // analog pin used to connect the potentiometer
int potpin2 = 1;
int potpin3 = 2;
int potpin4 = 3;
int val1; // variable to read the value from the analog pin
int val2;
int val3;
int val4;

void setup()
{
myservo1.attach(9); // attaches the servo on pin 9 to the servo object
myservo2.attach(10);
myservo3.attach(11);
myservo4.attach(13);
}

void loop()
{
val1 = analogRead(potpin1); // reads the value of the potentiometer (value between 0 and 1023)
val2 = analogRead(potpin2);
val3 = analogRead(potpin3);
val4 = analogRead(potpin4);
val1 = map(val1, 0, 1023, 0, 179); // scale it to use it with the servo (value between 0 and 180)
val2 = map(val2, 0, 1023, 0, 179);
val3 = map(val3, 0, 1023, 0, 179);
val4 = map(val4, 0, 1023, 0, 179);
myservo1.write(val1); // sets the servo position according to the scaled value
myservo2.write(val2);
myservo3.write(val3);
myservo4.write(val4);
delay(5); // waits for the servo to get there
}