write tree passes test