 void moveMotorOnSide(Direction side, Direction orientation, int speed)
 {
 	speed = max(min(speed, 180), 0);
-
-	if (side == right)
-	{
-		if (orientation == forward)
-		{
-			digitalWrite(12, HIGH);
-			analogWrite(3, speed);
-		}
-		else
-		{
-			digitalWrite(12, LOW);
-			analogWrite(3, speed);
-		}
-
-	}
-	else
-	{
-		if (orientation == forward)
-		{
-			digitalWrite(13, HIGH);
-			analogWrite(11, speed);
-		}
-		else
-		{
-			digitalWrite(13, LOW);
-			analogWrite(11, speed);
-		}
-
-	}
-
+	
+	digitalWrite(side == left ? 13 : 12, orientation == forward ? HIGH : LOW);
+	analogWrite(side == left ? 3 : 11, speed);
 }
 
 void moveBothMotors(int speedLeft, int speedRight)

const float derivateConst = 1.0f;

const int standardMotorSpeed = 180;

#pragma region "OldCode"

// TODO nicht ntig, weil nur einmal verwendet und der Speicherbedarf klein bleiben soll
//const int speedA = 3;  //speed control for motor outputs 1 and 2 is on digital pin 10  (Right motor)
//const int speedB = 11; //speed control for motor outputs 3 and 4 is on digital pin 11  (Left motor)
//const int dirA = 12;  //direction control for motor outputs 1 and 2 is on digital pin 12  (Right motor)
//const int dirB = 13;  //direction control for motor outputs 3 and 4 is on digital pin 13  (Left motor)

// TODO nie benutzt
//int turnSpeed = 200;  // tune value motors will run while turning (0-255) NOT TESTED
//int turnSpeedSlow = 125;  // tune value motors will run as they slow down from turning cycle to avoid overrun (0-255) NOT TESTED

#pragma endregion

int drivePastDelay = 300; // tune value in mseconds motors will run past intersection to align wheels for turn NOT TESTED



	Serial.println((int)position - 2500);
}
