setting global variable for tree algorithm