private void gameLoop() {
		long previousTick = System.nanoTime();
		long previousUpdate = System.nanoTime();
		long nanosecondsPerUpdate = (long) ((float) MathHelper.MILLIARD / (float) updaterate);

		while (!Display.isCloseRequested() && isRunning) {
			long currentTime = System.nanoTime();
			long deltaTime = currentTime - previousUpdate;

			if (currentTime - previousTick >= MathHelper.MILLIARD) {
				previousTick += MathHelper.MILLIARD;
				Display.setTitle(title);
				ups = updates;
				updates = 0;
				fps = frames;
				frames = 0;
				tick();
			}

			if (deltaTime >= nanosecondsPerUpdate) {
				previousUpdate += nanosecondsPerUpdate;
				double delta = (double) deltaTime / (double) nanosecondsPerUpdate;
				update(delta);
				updates++;
			}

			render();
			frames++;

			Display.update();
			Display.sync(framerate);
		}

		isInitialized = false;
		Display.destroy();
	}