I have the following code which is a modification of DFS that detects whether an undirected graph has a cycle.

```
graph = {
    'A' : set(['B', 'C']),
    'B' : set(['D', 'E', 'A']),
    'C' : set(['A', 'F']),
    'D' : set(['B']),
    'E' : set(['B', 'F']),
    'F' : set(['C','E'])
}

def find_cycle(graph, start):
    colors = { node : "WHITE" for node in graph }
    colors[start] = "GRAY"
    stack = [start]
    while stack:
        for neighbor in graph[stack[-1]]:
            if colors[neighbor] == "GRAY":
                return True
            elif colors[neighbor] == "WHITE":
                colors[neighbor] = "GRAY"
                stack.append(neighbor)
            else:
                colors[neighbor] = "BLACK"
                stack.pop()
     return False

```

No matter what my graph looks like, it always returns true and I can't figure out what i'm doing wrong. The algorithm works when I trace it on paper but the implementation doesn't translate to working code.