     return powerEnabled || (!powerEnabled && currentSpeed == 0);
 }
 
-int ReadPotentiometer(int pin)
+int analogReadMultisampled(int pin)
 {
   const int numberOfSamples = 5;
   


  if (powerEnabled)
  {
    targetSpeed = ReadPotentiometer(speedInPin);
    targetSpeed = map(targetSpeed, 0, potentiometerCeiling, minimumSpeed, 255);
    if (targetDirection == COUNTER_CLOCKWISE)
    {

    targetSpeed = 0;
  }

  int newDelayBetweenMotorUpdates = analogRead(rateOfSpeedChangeInPin);
  newDelayBetweenMotorUpdates = map(newDelayBetweenMotorUpdates, 0, potentiometerCeiling, minimumDelay, maximumDelay);
  int absoluteCurrentSpeed = abs(currentSpeed);
  if (absoluteCurrentSpeed > abs(targetSpeed) && absoluteCurrentSpeed < startOfStopDamping)
