debugging the circuit finding algorithm.