public ArrayList<ArrayList<Integer>> levelOrder(TreeNode root) {
		ArrayList<ArrayList<Integer>> result = new ArrayList<ArrayList<Integer>>();
		if (root == null)
			return result;
		// the algo is based on bfs, here I need a queue data structure
		ArrayList<TreeNode> queue = new ArrayList<TreeNode>();
		queue.add(root);
		ArrayList<Integer> root_value = new ArrayList<Integer>();
		// this is a special case, the value of the root should
		// be added first.
		root_value.add(root.val);
		result.add(root_value);//
		while (!queue.isEmpty()) {
			// all the nodes of the next level
			ArrayList<TreeNode> next_level = new ArrayList<TreeNode>();
			for (TreeNode t : queue) {
				// iterate through the queue
				ArrayList<TreeNode> temp_treenode = getChildren(t);
				// append all of the next level node to next_level
				next_level.addAll(temp_treenode);
			}
			// clear the queue
			queue = new ArrayList<>();
			// special case, if there's no next level nodes
			if (next_level.size() != 0) {
				queue.addAll(next_level);
				result.add(getValue(next_level));
			}
		}
		return result;
	}