drawTree as seperate function