rewrite runner of TransitiveClosure with Philip