Updated tree_GetAt function