Changed tree function implementation, adjusted tree_with_mixin accordingly.