implement tree with pseudo test