added set of procIds in recursive call to `reachable`