added basic logic for tree list generation