basic stack and make disjoint better