Adding fdtree implementation