public ArrayList<Integer> inorderTraversal(treeNode root) {
		ArrayList<Integer> valsInOrder = new ArrayList<Integer>();
		Stack<treeNode> nodesInOrder = new Stack<treeNode>();
		ArrayList<treeNode> visited = new ArrayList<treeNode>();

		if (root == null)
			return valsInOrder;

		// push root to stack as starting point
		nodesInOrder.push(root);

		treeNode curRoot = null;
		while (!nodesInOrder.isEmpty()) {
			curRoot = nodesInOrder.peek(); // check value
			if (curRoot.leftLeaf != null && !visited.contains(curRoot)) { // has
																			// left
																			// leaf,
																			// and
																			// it's
																			// visited
																			// for
																			// first
																			// time
				nodesInOrder.push(curRoot.leftLeaf);
				visited.add(curRoot);
			} else { // no left leaf, pop out, and push right leaf in if there
						// is any
				nodesInOrder.pop();
				valsInOrder.add(new Integer(curRoot.value));
				if (curRoot.rightLeaf != null) {
					nodesInOrder.push(curRoot.rightLeaf);
				}
			}
		}

		return valsInOrder;
	}