update LCA Algorithm