public void run() {
		Thread thisThread = Thread.currentThread();
		while (runner == thisThread) {
			try {
				if (reset > -1) {
					clearScreenAndReset();
				}
				nextpoints(alg);

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

					Thread.sleep(100);
				}
				painter.repaint();
			} catch (Exception e) {
				e.printStackTrace();
			}
		}
	}