public WeightedMove getBestMove(ChessGame game, int player, int depth){
		calls++;
		ArrayList<WeightedMove> possibleMoves = new ArrayList<WeightedMove>();
		int[][] board = game.getBoard();
		for(int x=0;x<8;x++){
			for(int y=0;y<8;y++){
				if(board[x][y]/7!=player)
					continue;
				Piece p = Piece.getPiece(board, x, y);
				if(p!=null){
					for(Move m:p.getPossibleMoves(game)){
						WeightedMove wm = new WeightedMove(m);
						wm.calculatingWeighting(game);
						//TODO possibly remove this line - do check earlier
						if(depth>0){
							wm.modifyWeighting(
									0-getBestMove(
											ChessGame.applyMove(game, wm),
											player==0 ? 1:0,
											depth-1
										).getWeighting()
									);
						}
						possibleMoves.add(wm);
					}
				}
			}
		}
		
		Collections.sort(possibleMoves);
		if(depth==MAX_RECURSION_DEPTH){
			System.out.println("Chosen: " + possibleMoves.get(0));
			System.out.println("Brute force calls: " + calls);
			calls = 0;
		}
		if(possibleMoves.size()==0){
			WeightedMove m = new WeightedMove(0,0,0,0);
			//TODO double check negative is correct
			//Pretty sure negative is correct.  It beat me...
			m.modifyWeighting(-Piece.KING_WEIGHT);
			return m;
		}
		return possibleMoves.get(0);
		
	}