improved Tree class, methods, functions