Cleaned up NDTree