public void run() {
		
		init();
		
		long startTime;
		long urdTime;
		long waitTime;
		
		while(running) {
			//check time
			
			this.remainingTime = this.settings.getTime()+ this.startTime - new Date().getTime()/1000;
		
			if(this.remainingTime<=0){
				menu.goToMenu("You run out of time!");
			
			}
			startTime = System.nanoTime();
			
			update();
			render();
			draw();
			
			urdTime = (System.nanoTime() - startTime) / 1000000;
			waitTime = targetTime - urdTime;
			
			try {
				Thread.sleep(waitTime);
			}
			catch(Exception e) {
			}
			
		}
		
	}