added tree functionality to network