 const int GENTLE_DELAY = 30;
 
 // milliseconds to wait between servo movement: when servo is shaking back & forth
-const int SHAKE_DELAY = 7;
+const int SHAKE_DELAY = 10;
 
 // maximum servo movement per iteration
 const int ANGLE_INCREMENT = 3;
 
 // milliseconds to wait at one end point before reversing rotation
 const int TURN_AROUND_DELAY = 10;
+
+// number of degrees to shake servo on each side of center
+const int SHAKE_OFFSET_ANGLE = 25;
 
 //
 // GLOBALS


void loop()
{
  // oscillateGently();

  currAngle = shakeServo(currAngle, random(5));
  delay(3000);
}

void oscillateGently()
{
  delay(TURN_AROUND_DELAY);
  //  Serial.println("------------------------------------------------------------");

  digitalWrite(13, HIGH);   // turn the LED on (HIGH is the voltage level)
  currAngle = turnServo(myservo, currAngle, RIGHT_LIMIT, GENTLE_DELAY);

  delay(TURN_AROUND_DELAY);
  //  Serial.println("++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++");

  digitalWrite(13, LOW);    // turn the LED off by making the voltage LOW
  currAngle = turnServo(myservo, currAngle, LEFT_LIMIT, GENTLE_DELAY);
}

int turnServo(Servo servo, int startAngle, int endAngle, int delayTime)

//
int shakeServo(int startAngle, int numShakes)
{
  int rightEnd = startAngle + SHAKE_OFFSET_ANGLE;
  int leftEnd = startAngle - SHAKE_OFFSET_ANGLE;

  turnServo(myservo, startAngle, rightEnd, SHAKE_DELAY);
  turnServo(myservo, rightEnd, leftEnd, SHAKE_DELAY);
