diff --git a/buggy.py b/buggy.py
--- a/buggy.py
+++ b/buggy.py
@@ -14,7 +14,7 @@
     ends = set(map(lambda x: x[1], chords))
     N = len(chords)
     s = []
-    for x in range(N):
+    for x in range(2 * N):
         if (x + 1) in starts:
             s.append(x + 1)
         elif (x + 1) in ends:
