implement acyclic