public void run() {
		Thread thisThread = Thread.currentThread();
		while (running) {
			try {

				if (reset > -1) {
					clearScreenAndReset(reset);
				}
				offscreenGraphics.setPaintMode();
				nextpoints(alg);

				Thread.sleep(100);

				long diff = (System.currentTimeMillis() - lastRunTime);
				if (diff > 5000) {
					lastRunTime = System.currentTimeMillis();
					updateHistogram();

				}
				painter.repaint(); // ew fire event
			} catch (Exception e) {
				e.printStackTrace();
			}
		}
		System.out.println("run() exited: " + thisThread.toString());
	}