<In> List<TreeNode<Label>> getPaths(List<In> input, F1<Label, In> selector) {

		ArrayDeque<RunState> stack = new ArrayDeque<RunState>();
		TreeNode<Label> root = TreeNode.create();

		List<TreeNode<Label>> acceptedPaths = new ArrayList<>();

		// add initial states to stack
		for (State initState : initialStates) {
			stack.push(new RunState(root, initState));
		}

		System.out.println("Initial states " + initialStates);

		while (!stack.isEmpty()) {
			RunState current = stack.pop();

			if (current.position == input.size()) {
				if (isAccept(current.state)) {
					// System.out.println("Accepted: " + (input.isEmpty() ? "" :
					// input.get(current.position-1)));
					current.paths.markAccept();
					acceptedPaths.add(current.paths);
				} else {
					continue;
				}
			}

			for (int i = 0; i < current.state.outgoing.size(); i++) {

				In nextSymbol = input.get(current.position);

				Transition<Label> transition = current.state.outgoing.get(i);
				// System.out.println(transition);
				if (transition.label == null
						|| selector.$(transition.label).equals(nextSymbol)) {
					System.out.printf("match %s - %s %n", nextSymbol,
							transition.label);

					stack.push(current.next(transition, current.paths));
				}

			}

		}

		return acceptedPaths;
	}