public void run() {
		long lastTime = System.nanoTime();
		long timer = System.currentTimeMillis();
		final double ns = 1000000000.0 / 60.0;
		double delta = 0;
		int frames = 0;
		int updates = 0;
		requestFocus();

		while (running) {
			int missedUpdates = 0;
			int missedRenders = 0;
			long now = System.nanoTime();
			delta += (now - lastTime) / ns;
			lastTime = now;
			while (delta >= 1) {
				try{
				update();
				updates++;
				delta--;
				}catch (Exception e){
					e.printStackTrace();
					missedUpdates++;
					System.out.println("Missed Update! " + missedUpdates);
				}
			}
			
			try{
			render();
			frames++;
			}catch (Exception e){
				e.printStackTrace();
				missedUpdates++;
				System.out.println("Missed Render! " + missedUpdates);
			}
			
			

			if (System.currentTimeMillis() - timer > 1000) {
				timer += 1000;
				frame.setTitle(title + " | " + updates + " ups, " + frames + " fps");
				updates = 0;
				frames = 0;
			}
		}
		stop();
	}