public ArrayList<ArrayList<Integer>> levelOrder (TreeNode root) {
		
		ArrayList<ArrayList<Integer>> result = new ArrayList<ArrayList<Integer>>();
		
		if (root == null) return result;
		
		Queue<TreeNode> queue = new LinkedList<TreeNode>();
				
		queue.add(root);
		
		while (!queue.isEmpty()) {
			ArrayList<Integer> tempValue = new ArrayList<Integer>();
			
			for (int i = 0; i < queue.size(); i++) {
				TreeNode node = queue.remove();
				if(node.left != null) queue.add(node.left);
				if(node.right != null) queue.add(node.right);
				
				tempValue.add(node.value);
			}
			
			result.add(tempValue);
		}
		
		return result;
	}