dptrees needs checking for bugs