Add tree implementation