Add a naive implementation of tree