public static ArrayList<Integer> inorderTraversal(TreeNode root) {
		TreeNode current = root;
		ArrayList<Integer> vals = new ArrayList<Integer>();
		
		while(current != null) {
			if(current.left == null) {
				//go right;
				vals.add(current.val);
				current = current.right;
			} else {
				//link current to left's right most child's right
				TreeNode p = current.left;
				while(p.right != null && p.right != current) {
					p = p.right;
				}
				
				if(p.right == null) {
					//link it.
					p.right = current;
					current = current.left;//go left;
				} else {
					//p is the right child found
					p.right = null;
					vals.add(current.val);
					current = current.right;// go right;
				}
			}
		}
		return vals;
	}