public ArrayList<Integer> preorderTraversal(treeNode root) {
		ArrayList<Integer> valsInPreOrder = new ArrayList<Integer>();
		Stack<treeNode> nodesInPreOrder = new Stack<treeNode>();

		if (root == null)
			return valsInPreOrder;

		// push root in to begin with
		nodesInPreOrder.push(root);

		// for each node in stack, pop it up, add right/left , so left is poping
		// up first;
		treeNode curRoot = null;
		while (!nodesInPreOrder.isEmpty()) {
			curRoot = nodesInPreOrder.pop();
			valsInPreOrder.add(new Integer(curRoot.value));
			// add right/left in stack
			if (curRoot.rightLeaf != null)
				nodesInPreOrder.push(curRoot.rightLeaf);
			if (curRoot.leftLeaf != null)
				nodesInPreOrder.push(curRoot.leftLeaf);
		}

		return valsInPreOrder;
	}