Replaced findcycles method with something more efficient based on SCC computation.