starting multithreading of treebuilder
combined all code
WORKS!