func drawing trees