public Move getMove(IBoard board) {
		Entry<Pair<IBoard, Move>, Double> bestEntry = null;
		double costOfMove = 0.0;
		for (Entry<Pair<IBoard, Move>, Double> entry : qmatrix.entrySet()) {
			double cost = entry.getValue();
			//Normal Moves
			if (isSameBoard(board, entry) && costOfMove < cost && cost <= 100.0 && !spawn) {
				costOfMove = cost;
				bestEntry = entry;
			}
			// Back off Moves.
			if (isSameBoard(board, entry) && cost == backOffMoveCost && spawn) {
				backOffMoveCost++;
				return entry.getKey().s;
			}
		}
		// Enable Back Off Moves after Spawning
		if (bestEntry.getKey().s == Move.SPAWN) {
			spawn = true;
		}
		qmatrix.remove(bestEntry);
		return bestEntry.getKey().s;
	}