public Move randomMove(boolean color) {

		HashMap<Integer, Entry<Point, ChessSquare>> numberedMovesList = new HashMap<Integer, Entry<Point, ChessSquare>>();
		HashMap<Integer, Entry<Point, Piece>> numberedMoves = new HashMap<Integer, Entry<Point, Piece>>();

		int listCounter = 0;
		int counter = 0;

		Random r = new Random();

		for (Entry<Point, ChessSquare> e : potentialMoves.entrySet()) {
			numberedMovesList.put(listCounter, e);
			listCounter++;
		}
		int moveIndex;
		while (true) {
			moveIndex = r.nextInt(numberedMovesList.size());
			if (!numberedMovesList.get(moveIndex).getValue().getInbound(color).isEmpty())
				break;
		}

		Set<Entry<Point, Piece>> tempEntrySet = numberedMovesList.get(moveIndex).getValue().getInbound(color)
				.entrySet();
		for (Entry<Point, Piece> e : tempEntrySet) {
			numberedMoves.put(counter, e);
			counter++;

		}
		int moveIndex2 = r.nextInt(numberedMoves.size());

		numberedMoves.get(moveIndex2).getKey();

		Move m = new Move(numberedMoves.get(moveIndex2).getKey(), numberedMovesList.get(moveIndex).getKey(),
				numberedMoves.get(moveIndex2).getValue());
		// System.out.println(m.toString());
		return m;

	}