     
   motor_stop(&motor1);
   
-  long average_no_interrupt_time = 0, average_interrupt_time = 0, average_interrupt_count = 0;
+  long average_no_interrupt_time = 0, average_interrupt_time = 0, average_interrupt_count = 0, delta;
 
   // print result table
-  Serial.println("| with       | without    | count      | est cost   |");
+  Serial.println("| with       | without    | delta      | count      | est cost   |");
   for (int i = 0; i < test_count; i++){
-    Serial.print("|    ");
-    Serial.print(interrupt_times[i]);
-    Serial.print(" |    ");
-    Serial.print(no_interrupt_times[i]);
-    Serial.print(" |        ");
-    Serial.print(interrupt_counts[i]);
-    Serial.print(" | ");
-    Serial.print((interrupt_times[i] - no_interrupt_times[i]) / (double)interrupt_counts[i], 8);
-    Serial.println(" |");
-
+    delta = interrupt_times[i] - no_interrupt_times[i];
+    print_table_row(interrupt_times[i], no_interrupt_times[i], interrupt_counts[i], delta,
+                    delta / (double)interrupt_counts[i]);
+
+    average_interrupt_time += interrupt_times[i];
     average_no_interrupt_time += no_interrupt_times[i];
-    average_interrupt_time += interrupt_times[i];
     average_interrupt_count += interrupt_counts[i];
   }
 
   average_no_interrupt_time /= test_count;
   average_interrupt_time /= test_count;
   average_interrupt_count /= test_count; 
-  
-  Serial.println("-----------------------------------------------------");
-  Serial.print("|    ");
-  Serial.print(average_interrupt_time);
-  Serial.print(" |    ");
-  Serial.print(average_no_interrupt_time);
-  Serial.print(" |        ");
-  Serial.print(average_interrupt_count);
-  Serial.print(" | ");
-  Serial.print((average_interrupt_time - average_no_interrupt_time) / (double)average_interrupt_count, 8);
-  Serial.println(" |");
-}
-#endif
+  delta = average_interrupt_time - average_no_interrupt_time;
+  
+  Serial.println("------------------------------------------------------------------");
+  print_table_row(average_interrupt_time, average_no_interrupt_time, average_interrupt_count, delta,
+                  delta / (double)average_interrupt_count);
+}
+#endif

}
#endif

#ifdef COMPONENT_TEST_INTERUPT_COST
void component_test_interupt_cost(){
  const int test_count = 10;
  const long iterations = 500000;
  
  long time_start, time_end, interrupt_count_start, interrupt_count_end;
  long no_interrupt_times[test_count], interrupt_times[test_count], interrupt_counts[test_count];


Motor motor1, motor2, motor3;




void setup() {
#ifdef KILLALL
  exit(0);
