@Override
	public void run() {
		init();
		double cores = Runtime.getRuntime().availableProcessors();
		Function[] functions = new Function[(int) cores];
		for (int i = 0; i < cores; i++) {
			Function f = new Function(functionString, -renderCubesize, renderCubesize, -renderCubesize, renderCubesize, -renderCubesize + 2 * (i) / cores * (renderCubesize + renderStepsize), -renderCubesize + 2 * (i + 1) / cores * (renderCubesize + renderStepsize), renderStepsize, new String[] {"x" , "y", "z"}, i + 1);
			Thread t = new Thread(f);
			t.start();
			functions[i] = f;
		}
		boolean flag0 = false;
		while (!flag0) {
			flag0 = true;
			for (int i = 0; i < cores; i++) {
				flag0 = flag0 && functions[i].isReady();
			}
			try {
				Thread.sleep(1000);
			} catch (InterruptedException e) {
				e.printStackTrace();
			}
		}
		while (!Keyboard.isKeyDown(Keyboard.KEY_ESCAPE) && !Display.isCloseRequested()) 
		{
			prerender();
			MovementHelper.moveToCharacter();
			drawAxii();
			for (int i = 0; i < cores; i++) {
				functions[i].render();
			}
			Display.update();
			MovementHelper.handleMovement();
			if (takeImageTimer++ % 12 == 0 && cinematicMode) takeScreenshot();
		}
	}