lessCommonAncestor added and Compute S set