 	}
 }
 
-byte getNumberOfCurrentlyWhiteSensors()
-{
-	byte currentlyWhiteSensors = 0;
-	for (byte i = 0; i < sizeof(sensorPins); i++)
+unsigned char getNumberOfCurrentlyWhiteSensors()
+{
+	unsigned char currentlyWhiteSensors = 0;
+	for (unsigned char i = 0; i < sizeof(sensorPins); i++)
 	{
 		if (sensorValues[i] < threshold)
 		{

{
	if (!isFirstRun)
	{
		direction = path[pathPositionInLaterRun];
		pathPositionInLaterRun++;
	}
	else

	switch (totalAngle)
	{
	case 0:
		simplePath[pathLength - 3].direction = forward;
		break;
	case 90:
		simplePath[pathLength - 3].direction = right;
		break;
	case 180:
		simplePath[pathLength - 3].direction = backward;
		break;
	case 270:
		simplePath[pathLength - 3].direction = left;
		break;
	}

	// The path is now two steps shorter.
	simplePath[pathLength - 1].direction = none;
	simplePath[pathLength - 2].direction = none;
	pathLength -= 2;
}

#pragma endregion

#pragma region "Leds"
void lightLed(unsigned char ledIndex)
{
	digitalWrite(ledPins[ledIndex], HIGH);
}

void turnOffAllLeds()
{
	for (unsigned char i = 0; i < sizeof(ledPins); i++)
	{
		digitalWrite(ledPins[i], LOW);
	}
}

void ledDirection(unsigned char ledDir)
{
	switch (ledDir)
	{
