foldTree progress, but I think height is wrong and also it's ugly as sin