diff --git a/.gitignore b/.gitignore
index da8aa77dbb4ff2ebb7cfdebefd10b52de0d79397..8a575a919413ecd58a227cdd15e3fde7a97c8b8e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -3,3 +3,4 @@ build
 *.o
 *.pdf
 main
+*_tests
diff --git a/src/draw.c b/src/draw.c
index ae3ffd92674b9ae027bb547494302a4934073d23..491f09aef908803131e14cd0d26615a555f89898 100644
--- a/src/draw.c
+++ b/src/draw.c
@@ -1,12 +1,12 @@
 #include <stdbool.h>
-
 #include "../utils/gfx/gfx.h"
-#include "field.h"
+#include "../utils/utils.h"
+
 
 void gfx_draw_line(struct gfx_context_t *ctxt, coordinates_t p0, coordinates_t p1, uint32_t color) {
-	int dx = abs((int)p1.column - (int)p0.column);
+	int dx = abs((int) p1.column - (int) p0.column);
 	int sx = p0.column < p1.column ? 1 : -1;
-	int dy = -abs((int)p1.row - (int)p0.row);
+	int dy = -abs((int) p1.row - (int) p0.row);
 	int sy = p0.row < p1.row ? 1 : -1;
 	int error = dx + dy;
 
@@ -34,29 +34,30 @@ void gfx_draw_line(struct gfx_context_t *ctxt, coordinates_t p0, coordinates_t p
 	}
 }
 
-void gfx_draw_circle(struct gfx_context_t *ctxt, coordinates c, uint32_t r, uint32_t color) {
-    int x = 0;
-    int y = r;
-    int d = r - 1;
-    while(y >= x){ 
-        gfx_putpixel(ctxt, c.column + x, c.row + y, color);
-        gfx_putpixel(ctxt, c.column + y, c.row + x, color);
-        gfx_putpixel(ctxt, c.column - x, c.row + y, color);
-        gfx_putpixel(ctxt, c.column - y, c.row + x, color);
-        gfx_putpixel(ctxt, c.column + x, c.row - y, color);
-        gfx_putpixel(ctxt, c.column + y, c.row - x, color);
-        gfx_putpixel(ctxt, c.column - x, c.row - y, color);
-        gfx_putpixel(ctxt, c.column - y, c.row - x, color);
-        if(d >= 2*x){ 
-            d = d-2*x-1;
-            x++;
-        }else if(d < 2 * ((int)r-y)){
-            d = d + 2*y-1;
-            y--;	
-        }else {
-            d = d + 2 * (y-x-1);
-            y--;
-            x++;
-        }
-    }
+
+void gfx_draw_circle(struct gfx_context_t *ctxt, coordinates_t c, uint32_t r, uint32_t color) {
+	int x = 0;
+	int y = r;
+	int d = r - 1;
+	while (y >= x) {
+		gfx_putpixel(ctxt, c.column + x, c.row + y, color);
+		gfx_putpixel(ctxt, c.column + y, c.row + x, color);
+		gfx_putpixel(ctxt, c.column - x, c.row + y, color);
+		gfx_putpixel(ctxt, c.column - y, c.row + x, color);
+		gfx_putpixel(ctxt, c.column + x, c.row - y, color);
+		gfx_putpixel(ctxt, c.column + y, c.row - x, color);
+		gfx_putpixel(ctxt, c.column - x, c.row - y, color);
+		gfx_putpixel(ctxt, c.column - y, c.row - x, color);
+		if (d >= 2 * x) {
+			d = d - 2 * x - 1;
+			x++;
+		} else if (d < 2 * ((int) r - y)) {
+			d = d + 2 * y - 1;
+			y--;
+		} else {
+			d = d + 2 * (y - x - 1);
+			y--;
+			x++;
+		}
+	}
 }
diff --git a/src/draw.h b/src/draw.h
index 5ac6b731f6bc9a958959c2cb23ecfe8d352f8f4d..af39d211b52d600537bfc2d65c33c772b4d257c2 100644
--- a/src/draw.h
+++ b/src/draw.h
@@ -3,7 +3,10 @@
 
 #include "field.h"
 
+
 void gfx_draw_line(struct gfx_context_t *ctxt, coordinates_t p0, coordinates_t p1, uint32_t color);
+
 void gfx_draw_circle(struct gfx_context_t *ctxt, coordinates_t c, uint32_t r, uint32_t color);
 
-#endif
\ No newline at end of file
+
+#endif
diff --git a/src/field.c b/src/field.c
index b29131a544b30c5be05a464221a2c28bc6169fc8..95f80f08c84b4f4223d977ed7ba0267ce719b18d 100644
--- a/src/field.c
+++ b/src/field.c
@@ -34,8 +34,7 @@ double compute_delta_x() {
 }
 
 bool is_in_screen(coordinates_t pos) {
-	// TODO: should this not be "<" instead of "<=" ?
-	return pos.column <= WID && pos.row <= HEI;
+	return pos.column < WID && pos.row < HEI;
 }
 
 bool draw_field_line_point(struct gfx_context_t *ctxt, charge_t *charges, int num_charges, double x0, double x1, double y0, double y1, vec2 pos, vec2 *pos_next, double delta) {
@@ -105,7 +104,7 @@ static bool draw_field_line(struct gfx_context_t *ctxt, charge_t *charges, int n
 /// A circle with minus sign for negative charges
 /// A circle with a plus sign for positive charges
 static void draw_charges(struct gfx_context_t *context, charge_t *charges, int num_charges, double x0, double x1, double y0, double y1) {
-	for (int i = 0; i < num_charges; i++) {
+	for (int i = 0; i < num_charges; ++i) {
 		coordinates_t charge_center = position_to_coordinates(WID, HEI, x0, x1, y0, y1, charges[i].pos);
 		gfx_draw_circle(context, charge_center, CHARGE_R, COLOR_WHITE);
 
diff --git a/src/field.h b/src/field.h
index 4f7c4bda28992220896da98df8282efd8c775677..4fb8f804599c14198ce51f0280a013e53e3d6956 100644
--- a/src/field.h
+++ b/src/field.h
@@ -2,9 +2,9 @@
 #define _PHYSIQUE_H_
 
 #include <stdio.h>
-#include "../utils/utils.h"
 #include "../utils/gfx/gfx.h"
 #include "../utils/vec2/vec2.h"
+#include "../utils/utils.h"
 
 #define SIDE_LEN 1000
 #define WID SIDE_LEN
diff --git a/src/main.c b/src/main.c
index 636c039808c75175bb824b7c7120b02417f14ab0..9c5e5a15d0b75e86d300438ac2d8000b8e3a6bde 100644
--- a/src/main.c
+++ b/src/main.c
@@ -1,20 +1,17 @@
 #include <stdlib.h>
-#include <time.h>
-
-#include "draw.h"
-#include "field.h"
-#include "../utils/utils.h"
 #include "field.h"
 
+
 #define NCHARGES 2
+#define NC 3
 #define DX 25
 #define NLINES 50
 
 
-int main() {
+void main_old() {
 	charge_t charges[NCHARGES] = {
-		charge_create(0.25, vec2_create(0.25, 0.5)),
-		charge_create(-0.25, vec2_create(0.75, 0.5))
+			charge_create(0.25, vec2_create(0.25, 0.5)),
+			charge_create(-0.25, vec2_create(0.75, 0.5))
 	};
 	struct gfx_context_t *ctxt = gfx_create("elec", WID, HEI);
 
@@ -23,5 +20,25 @@ int main() {
 
 	while (gfx_keypressed() != SDLK_ESCAPE);
 	gfx_destroy(ctxt);
+}
+
+
+void main_new() {
+	charge_t charges[NC];
+	for (int i = 0; i < NC; ++i)
+		charges[i] = charge_create(i % 2 == 0 ? rand_one() : -rand_one(), vec2_create(rand_one(), rand_one()));
+	struct gfx_context_t *ctxt = gfx_create("elec", WID, HEI);
+
+	draw_everything(ctxt, charges, NC, NLINES, DX, 0.0, 1.0, 0.0, 1.0);
+	gfx_present(ctxt);
+	while (gfx_keypressed() != SDLK_ESCAPE) {
+		gfx_present(ctxt);
+	}
+	gfx_destroy(ctxt);
+}
+
+
+int main() {
+	main_new();
 	return EXIT_SUCCESS;
 }
diff --git a/utils/utils.c b/utils/utils.c
index 24feb7a083f988fc06b1ebe061aa475c053d15a1..2b2d974a6435805567901fdc7e01fdf331565f34 100644
--- a/utils/utils.c
+++ b/utils/utils.c
@@ -1,8 +1,8 @@
 #include <math.h>
 #include <stdlib.h>
 #include <time.h>
-#include "utils.h"
 #include "vec2/vec2.h"
+#include "utils.h"
 
 
 coordinates_t coordinates_create(int row_, int column_) {