public int maxPathSum(treeNode curRoot) {
		int maxPathNotRoot;
		int maxPathAsRoot;
		int curMax;
		int maxPathFinal = 0;
		treeNode p = curRoot;

		// max for left tree
		do {
			p = p.leftLeaf;
			maxPathNotRoot = maxPathNotRoot(p);
			maxPathAsRoot = maxPathAsRoot(p);

			curMax = maxPathNotRoot > maxPathAsRoot ? maxPathNotRoot
					: maxPathAsRoot;
			if (curMax > maxPathFinal) {
				maxPathFinal = curMax;
				this.highestPointForMaxPath = p;
			}
		} while (p != null);

		p = curRoot;
		// max for right tree
		do {
			p = p.rightLeaf;
			maxPathNotRoot = maxPathNotRoot(p);
			maxPathAsRoot = maxPathAsRoot(p);

			curMax = maxPathNotRoot > maxPathAsRoot ? maxPathNotRoot
					: maxPathAsRoot;
			if (curMax > maxPathFinal) {
				maxPathFinal = curMax;
				this.highestPointForMaxPath = p;
			}
		} while (p != null);

		// max for root
		maxPathNotRoot = maxPathNotRoot(curRoot);
		maxPathAsRoot = maxPathAsRoot(curRoot);

		curMax = maxPathNotRoot > maxPathAsRoot ? maxPathNotRoot
				: maxPathAsRoot;
		if (curMax > maxPathFinal) {
			maxPathFinal = curMax;
			this.highestPointForMaxPath = curRoot;
		}

		System.out.println("Running time for method 1:"
				+ this.running_time_asRoot + "/" + this.running_time_NotRoot);
		return maxPathFinal;
	}