diff --git a/info.cpp b/info.cpp
index 9d6d6fd4bfe82e97c51db112d6d817fd98314928..f8dfaae0b22b82d493bb1fa9817702681b697143 100644
--- a/info.cpp
+++ b/info.cpp
@@ -16,12 +16,10 @@ int main(int argc, char *argv[]) {
     fclose(fp);
 
     int i = 0;
-    for(auto s = scop->statement; s; s = s->next) {
-        int j = s->domain->nb_output_dims;
-        while(j > 0) {
-            std::cout << i << " " << --j << "\n";
+    for(auto s = scop->statement; s; s = s->next, i++) {
+        for(int j = 0; j < s->domain->nb_output_dims; j++) {
+            std::cout << i << " " << j << "\n";
         }
-        i++;
     }
 
     return 0;