implement dtree.js