Added methods to find all loops in graph