New implementation of tree