Completed first version of d-tree