use contains instead of compareDocumentPosition for LCA