I'm wondering if anyone can help me get a servo motor running via serial commands using Arduino and the Servo.h library. I've written some code but not sure if this will get the motor running...can somoene please feedback and advise? Thanks

----------------
#include <Servo.h>
Servo myservo; // create servo object to control a servo
// a maximum of eight servo objects can be created
int pos = 0; // variable to store the servo position
void setup()
{
myservo.attach(9); // attaches the servo on pin 9 to the servo object
myservo.write(90); //set servo to midpoint as default
Serial.begin(9600);
Serial.print("Ready");
}
void loop()
{
if (Serial.available() > 0)
{
int value = Serial.read(); //reads the incoming byte
switch(value)
{
case 'a':
pos = 1023;
pos = map(pos, 0, 1023, 0, 179);
myservo.write(pos);
break;
case 'b':
pos = 0;
pos = map(pos, 0, 1023, 0, 179);
myservo.write(pos);
break;
case 'c':
pos = 1023/2;
pos = map(pos, 0, 1023, 0, 179);
myservo.write(pos);
break;
case 'd':
pos = 1023/4;
pos = map(pos, 0, 1023, 0, 179);
myservo.write(pos);
break;
case 'e':
pos = 1023/8;
pos = map(pos, 0, 1023, 0, 179);
myservo.write(pos);
break;
case 'f':
pos = -1023;
pos = map(pos, 0, -1023, 0, 179);
myservo.write(pos);
break; // serial input read and stored
//in shaft to be used as input value for position
}
}
//Default movement without serial input
for(pos = 0; pos < 180; pos += 1) // goes from 0 degrees to 180 degrees
{ // in steps of 1 degree
myservo.write(pos); // tell servo to go to position in variable 'pos'
delay(15); // waits 15ms for the servo to reach the position
}
for(pos = 180; pos>=1; pos-=1) // goes from 180 degrees to 0 degrees
{
myservo.write(pos); // tell servo to go to position in variable 'pos'
delay(15); // waits 15ms for the servo to reach the position
}
}