public static Set<Node> decodeSet(String input) throws IllegalArgumentException {
		
//		System.out.println("Decoding:");
//		System.out.println(input);
		
		String[] split = input.split("\\n",2);
		if (!split[0].equals("Set"))
			throw new IllegalArgumentException();
		
		String curInput = split[1].trim();
		split = curInput.split("\\s+",3);
		if (!split[0].equals("size")) 
			throw new IllegalArgumentException();
		
		int setSize = 0;
		try {
			setSize = Integer.parseInt(split[1]);
		} catch (NumberFormatException e) {
			throw new IllegalArgumentException(e.getMessage());
		}
		
		HashSet<Node> set = new HashSet<Node>();
		if (setSize == 0)
			return set;
		
		curInput = split[2].trim();
		split = curInput.split("Node\\n");
		
		if (split.length != setSize + 1)
			throw new IllegalArgumentException();
		
		for (int i = 1; i < setSize; i++) {
			set.add(decodeNode("Node\n"+split[i]));
		}
		return set;
	}