private void DFS(ArrayList<Boolean> initialState,
			HashMap<Integer, Boolean> explored, ArrayList<String> resultArr,
			ArrayList<String> stateNames)
	{
		int currentStateNumber = CircuitHelpers.binaryToDecimal(initialState);
		// Check if the state has already been explored or not
		if (explored.containsKey(currentStateNumber))
			return;
		else
		{
			String result = "S" + currentStateNumber + ":\n";
			stateNames.add("S" + currentStateNumber);
			ArrayList<Integer> nextStates = new ArrayList<Integer>();

			// Mark the state as explored
			explored.put(currentStateNumber, true);

			// assign the flip flops states to this configuration
			CircuitHelpers.mapFlipFlopsCurrentStates(flipflops, initialState);

			// Try all the inputs and DFS the next States they bring
			ArrayList<ArrayList<Boolean>> allInputsCombinations = CircuitHelpers
					.binaryCombination(inputs.size());
			for (int inputCombination = 0; inputCombination < allInputsCombinations
					.size(); inputCombination++)
			{
				// Assign the input values to the current combination
				CircuitHelpers.mapInputValues(inputs,
						allInputsCombinations.get(inputCombination));
				for (Input input : inputs)
					result += input.name + "="
							+ CircuitHelpers.boolToInteger(input.getValue())
							+ " ";

				// Find the next state
				int nextState = CircuitHelpers.nextStatesToDecimal(flipflops);
				result += "-> S" + nextState;
				if (!nextStates.contains(nextState))
					nextStates.add(nextState);

				// Find the outputs
				for (Output output : outputs)
					result += "," + output.name + "="
							+ CircuitHelpers.boolToInteger(output.getValue())
							+ " ";

				if (inputCombination != allInputsCombinations.size() - 1)
					result += "\n";
			}

			// Add This part to the result
			resultArr.add(result);

			// DFS all the reachable states
			for (int i = 0; i < nextStates.size(); i++)
			{
				ArrayList<Boolean> nextStateCombination = CircuitHelpers
						.decimalToBinary(nextStates.get(i), flipflops.size());
				DFS(nextStateCombination, explored, resultArr, stateNames);
			}
		}

	}