add trees implementation