 }
 
 void setMotors(int speed, int direction) {
-	setMotorLeft(speed, direction);
-	setMotorRight(speed, direction);
+  setMotorLeft(speed, direction);
+  setMotorRight(speed, direction);
 }
 
 void setMotorLeft(int speed, int direction) {
-	int controlBit = direction == FORWARD ? 1 : 0;
+  int controlBit = direction == FORWARD ? 1 : 0;
   analogWrite(enablePin_1, speed);
   digitalWrite(in1Pin_1, controlBit);
   digitalWrite(in2Pin_1, ! controlBit);
 }
 
 void setMotorRight(int speed, int direction) {
-	int controlBit = direction == FORWARD ? 1 : 0;
+  int controlBit = direction == FORWARD ? 1 : 0;
   analogWrite(enablePin_2, speed);
   digitalWrite(in3Pin_2, ! controlBit);
   digitalWrite(in4Pin_2, controlBit);
 }
 
 void computeMeans() {
-	int dimension = 1;
-	int clusters = 3;
-	double errorTolerance = 0.01;
-	double** centroids = (double**)calloc(clusters, sizeof(double*));
+  int dimension = 1;
+  int clusters = 3;
+  double errorTolerance = 0.01;
+  double** centroids = (double**)calloc(clusters, sizeof(double*));
 
-	int* labels = k_means(dataPoints, numDataPoints, dimension, clusters, errorTolerance, centroids);
-	for (int i = 0; i < numDataPoints; i++) {
-		aprintf("data point %d is in cluster %d\n", dataPoints[i][0]	, labels[i]);
-	}
-	free(labels);
-	free(centroids);
+  int* labels = k_means(dataPoints, numDataPoints, dimension, clusters, errorTolerance, centroids);
+  for (int i = 0; i < numDataPoints; i++) {
+    char string[100];
+    sprintf(string, "data point %f is in cluster %f\n", (float)dataPoints[i][0], (float)labels[i]);
+    Serial.println(string);
+  }
+  free(labels); 
+  free(centroids);
 }
 
 void collectIntialData() {
-	int* values = getSensorValues();
-	dataPoints[collectedPoints][0] = (double) values[0];
-	dataPoints[collectedPoints + 1][0] = (double) values[1];
-	dataPoints[collectedPoints + 2][0] = (double) values[2];
-	dataPoints[collectedPoints + 3][0] = (double) values[3];
+  int* values = getSensorValues();
+  // dataPoints[collectedPoints][0] = (double) values[0];
+  // dataPoints[collectedPoints + 1][0] = (double) values[1];
+  // dataPoints[collectedPoints + 2][0] = (double) values[2];
+  // dataPoints[collectedPoints + 3][0] = (double) values[3];
 }
 
 int* getSensorValues() {
-	int values[4];
-	values[0] = analogRead(diod1Pin);
-	values[1] = analogRead(diod2Pin);
-	values[2] = analogRead(diod3Pin);
-	values[3] = analogRead(diod4Pin);
-	Serial.println("" + values[0] + values[1] + values[2] + values[3]);
-	return values;
+  int values[4];
+  values[0] = analogRead(diod1Pin);
+  values[1] = analogRead(diod2Pin);
+  values[2] = analogRead(diod3Pin);
+  values[3] = analogRead(diod4Pin);
+
+  char string[100];
+  sprintf(string, "sensor values: %d, %d, %d and %d", values[0], values[1], values[2], values[3]);
+  Serial.println(string);
+  return values;
 }

void RotateLeft(int time) // inverse voltage of only one motor
{
  Serial.println("rotate left");
	setMotorLeft(DEFAULT_SPEED, BACKWARD);
	setMotorRight(DEFAULT_SPEED, FORWARD);
	delay(time);
	Stop();
	delay(STOP_TIME);
  /*digitalWrite(motor1PinA, LOW);
  digitalWrite(motor1PinB, HIGH);
  digitalWrite(motor2PinA, HIGH);

void Backward(int time) // inverse voltage of both motors
{
  Serial.println("move backward");
  setMotors(DEFAULT_SPEED, BACKWARD);
  delay(time);
  Stop();
  delay(STOP_TIME);
  /*digitalWrite(motor1PinA, LOW);
  digitalWrite(motor1PinB, HIGH);
  digitalWrite(motor2PinA, LOW);
