diff --git a/baron/indentation_marker.py b/baron/indentation_marker.py
index <HASH>..<HASH> 100644
--- a/baron/indentation_marker.py
+++ b/baron/indentation_marker.py
@@ -26,7 +26,7 @@ def mark_indentation(sequence):
 def mark_indentation_generator(sequence):
     iterator = FlexibleIterator(sequence)
     current = None, None
-    indent = 0
+    indentations = []
     while True:
         if iterator.end():
             return
@@ -36,14 +36,14 @@ def mark_indentation_generator(sequence):
         if current is None:
             return
 
-        if current[0] == "ENDMARKER" and indent:
-            while indent > 0:
+        if current[0] == "ENDMARKER" and indentations:
+            while len(indentations) > 0:
                 yield ('DEDENT', '')
-                indent -= 1
+                indentations.pop()
 
         print current, iterator.show_next()
         if current[0] == "COLON" and iterator.show_next()[0] == "ENDL":
-            indent += 1
+            indentations.append(0)
             yield current
             yield iterator.next()
             yield ('INDENT', '')
[mod] start to move to a list storing all the indetations