ids are now unique if tree id exists
refactored tree id piece to function
#3 refactored tree id piece to initialization
#3 fixed and ready to merge