automatically draw trees