implementing tree