public Move findbest(Game g) throws GameException {
		try {
			boolean max;
			int bestVal;

			// if first player, then find the max value
			// otherwise find the min value
			if (g.whoseTurn() == Game.FIRST_PLAYER) {
				max = true;
				bestVal = Integer.MIN_VALUE; // running max, starts at bottom
			} else {
				max = false;
				bestVal = Integer.MAX_VALUE;
			}

			Move bestMove = null;
			Iterator<Move> moves = g.getMoves();

			while (moves.hasNext()) {
				int value;
				Move m = moves.next();
				Game cp = g.copy();
				cp.make(m);
				value = getValue(cp);
				System.out.println("val = " + value);
				if ((max && value >= bestVal) || (!max && value <= bestVal)) {
					bestVal = value;
					bestMove = m;
				}
			}
			return bestMove;
		} catch (Exception e) {
			throw new GameException(e.getMessage());
		}
	}