zip tree functions