First functional version - now is functionality the same as in original TreeManager