added isCycle

isCycle takes two groups, and checks if the second group is connected
to the first group as an input at any level
added isCycle when connecting lines