initial tree implementation