added LYAH's treeInsert and my partially implemented treeElem (with LYAH improvements)