Initial implementation of tree drawing algorithm