private static void drawHistogram(GC gc, int x, int y, int[] histogram, int MAX, int width, int height) {

		int gap = 1;
		gc.setForeground(Colors.red);
		int thickness = 5;
		gc.drawRectangle(x - thickness, y - thickness, 256 * gap + 2 * thickness, height + 2 * thickness);

		gc.setForeground(Colors.blue);
		gc.setLineWidth(1);
		for (int i = 0; i < histogram.length; i++) {

			int y2 = y + height;
			int y1 = y2 - histogram[i] * height / MAX;
			gc.drawLine(x + (i * gap), y1, x + (i * gap), y2);
		}
	}