added immutable tree implementation