private void drawGrid(Graphics2D g2d) {
		g2d.setColor(Color.black);
		float lineThickness = Math.max(SIZE / 10f - 1f, 1f);

		g2d.setStroke(new BasicStroke(lineThickness));
		// draw the normal grid
		for (int i=0; i<=height; i++) {
			g2d.drawLine(0, i*SIZE, width*SIZE, i*SIZE);
		}
		for (int i=0; i<=width; i++) {
			g2d.drawLine(i*SIZE, 0, i*SIZE, height*SIZE);
		}

		// draw the thicker lines, every 10 fields.
		g2d.setStroke(new BasicStroke(lineThickness * 2f));
		for (int i=0; i<(width/10+1); i++) {
			g2d.drawLine(i*10*SIZE, 0, i*10*SIZE, height*SIZE);
		}
		for (int i=0; i<(height/10+1); i++) {
			g2d.drawLine(0, i*10*SIZE, width*SIZE, i*10*SIZE);
		}
		if (width % 10 != 0)
			g2d.drawLine(width*SIZE, 0, width*SIZE, height*SIZE);
		if (height % 10 != 0)
			g2d.drawLine(0, height*SIZE, width*SIZE, height*SIZE);
	}