public KrakenMove makeDecision(KrakenState state) {
		XYLocation rivalKing = state.getKingLocation(state.getPlayerToMove().equals(KrakenColor.WHITE_PLAYER)? KrakenColor.BLACK_ITEM:KrakenColor.WHITE_ITEM);
		List<KrakenMove> myMoves= state.actions(state.getPlayerToMove().toLowerCase());
		
		// kill the rival king
		for (int i = 0; i < myMoves.size(); i++) {
			if (myMoves.get(i).getFinalPlace().equals(rivalKing)) return myMoves.get(i);
		}
		// save my king
		for (int i = myMoves.size()-1; i >=0; i--) {
			if (deleteSuicideMove(game.getResult(state.clone(), myMoves.get(i))))
				myMoves.remove(i);	
		}
		// If all the moves kill my king, execute someone
		if (myMoves.size()==0){
			System.out.println("<------CHECK MATE------>");
			myMoves= game.getActions(state);
			return myMoves.get( (int) (Math.random() * myMoves.size() ));
		}
		
		// alpha-Beta search
		expandedNodes = 0;
		double maxValue = Double.NEGATIVE_INFINITY;
		String player = state.getPlayerToMove();
		KrakenMove [] moves = new KrakenMove[myMoves.size()];
		double [] values = new double[myMoves.size()];
		int index = 0;
		for (KrakenMove move : myMoves) {
			double value = minValue(game.getResult(state.clone(), move), player,Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY);
			if (value >= maxValue) 
				maxValue = value;
			moves[index]= move;
			values[index++]= value;
			expandedNodes = 0;
		}
		return getMaxValue(maxValue,moves,values,state);
	}