public Matrix(int n) {
		if (n < 0)
			throw new IllegalArgumentException("n = " + n);
		
		HashMap<Integer, HashMap<Integer, Node>> a = new HashMap<Integer, HashMap<Integer, Node>>();
		matrix = a;
		size = n;
		// Initiates all x-coordinates and each x-coordinate's HashMap
		// (y-dimension, each coordinate features one node).
		for (int i = 0; i < n; i++) {
			// Initiates all x-coordinates (the key is i, ranging from 0 to n, the value
			// is the current x-coordinate's hashmap in the y-dimension).
			matrix.put(i, new HashMap<Integer, Node>());
			
			// Initiates all y-coordinates and each y-coordinate's node.
			// All nodes are Spaces by default.
			for (int k = 0; k < n; k++) {
				matrix.get(i).put(k, new Space(i, k));
			}
		}
	}