private void doOnce() throws InterruptedException { 
    	
    	if(iteration > 15 || (iteration > 2 && game.board.whiteMoves == "")){
    		throw new InterruptedException();
    	}
    	
    	Piece.Type otherPlayer = player;
		
		MiniMaxTree mmt = new MiniMaxTree(game.copyGame());
		try{
			mmt.processToDepth(iteration,start,limit);
		}
		catch(StackOverflowError e){
			iteration = 100;
		}
		
		if(otherPlayer == Piece.Type.BLACK){
			int minimum = 100000;
			for(int i = 0; i < mmt.root.children.size();i++){
				if(mmt.root.children.get(i).getUtilityValue() < minimum){
					bestMove = mmt.root.children.get(i).getState().getMove(false);
					minimum = mmt.root.children.get(i).getUtilityValue();
				}
			}
		}
		else{
			int maximum = -100000;
			for(int i = 0; i < mmt.root.children.size();i++){
				if(mmt.root.children.get(i).getUtilityValue() > maximum){
					bestMove = mmt.root.children.get(i).getState().getMove(true);
					maximum = mmt.root.children.get(i).getUtilityValue();
				}
			}
		}
		System.out.println("Set best move as "+bestMove);
		iteration++;
    }