Index: lab5.c
===================================================================
--- lab5.c	(revision 132)
+++ lab5.c	(revision 133)
@@ -61,12 +61,12 @@
 
     if (vg_exit()) {
         printf("%s: vg_exit failed to exit to text mode.\n", __func__);
-        if (free_memory())
+        if (free_memory_map())
             printf("%s: lm_free failed\n", __func__);
         return 1;
     }
 
-    if (free_memory()) {
+    if (free_memory_map()) {
         printf("%s: lm_free failed\n", __func__);
         return 1;
     }
@@ -96,7 +96,7 @@
     if (vg_draw_rectangle(x, y, width, height, color)) {
         if (vg_exit()) {
             printf("%s: vg_exit failed to exit to text mode.\n", __func__);
-            if (free_memory()) printf("%s: lm_free failed\n", __func__);
+            if (free_memory_map()) printf("%s: lm_free failed\n", __func__);
         }
         return 1;
     }
@@ -111,7 +111,7 @@
     if (subscribe_kbc_interrupt(kbc_irq_bit, &kbc_id)) {
         if (vg_exit()) {
             printf("%s: vg_exit failed to exit to text mode.\n", __func__);
-            if (free_memory()) printf("%s: lm_free failed\n", __func__);
+            if (free_memory_map()) printf("%s: lm_free failed\n", __func__);
         }
         return 1;
     }
@@ -142,7 +142,7 @@
     if (unsubscribe_interrupt(&kbc_id)) {
         if (vg_exit()) {
             printf("%s: vg_exit failed to exit to text mode.\n", __func__);
-            if (free_memory()) printf("%s: lm_free failed\n", __func__);
+            if (free_memory_map()) printf("%s: lm_free failed\n", __func__);
         }
         return 1;
     };
@@ -149,11 +149,11 @@
 
     if (vg_exit()) {
         printf("%s: vg_exit failed to exit to text mode.\n", __func__);
-        if (free_memory()) printf("%s: lm_free failed\n", __func__);
+        if (free_memory_map()) printf("%s: lm_free failed\n", __func__);
         return 1;
     }
 
-    if (free_memory()) {
+    if (free_memory_map()) {
         printf("%s: lm_free failed\n", __func__);
         return 1;
     }
@@ -196,7 +196,7 @@
             if (vg_draw_rectangle(col*W,row*H,W,H,color)) {
                 if (vg_exit()) {
                     printf("%s: vg_exit failed to exit to text mode.\n", __func__);
-                    if (free_memory()) printf("%s: lm_free failed\n", __func__);
+                    if (free_memory_map()) printf("%s: lm_free failed\n", __func__);
                 }
                 return 1;
             }
@@ -212,7 +212,7 @@
     if (subscribe_kbc_interrupt(kbc_irq_bit, &kbc_id)) {
         if (vg_exit()) {
             printf("%s: vg_exit failed to exit to text mode.\n", __func__);
-            if (free_memory()) printf("%s: lm_free failed\n", __func__);
+            if (free_memory_map()) printf("%s: lm_free failed\n", __func__);
         }
         return 1;
     }
@@ -243,7 +243,7 @@
     if (unsubscribe_interrupt(&kbc_id)) {
         if (vg_exit()) {
             printf("%s: vg_exit failed to exit to text mode.\n", __func__);
-            if (free_memory()) printf("%s: lm_free failed\n", __func__);
+            if (free_memory_map()) printf("%s: lm_free failed\n", __func__);
         }
         return 1;
     };
@@ -250,11 +250,11 @@
 
     if (vg_exit()) {
         printf("%s: vg_exit failed to exit to text mode.\n", __func__);
-        if (free_memory()) printf("%s: lm_free failed\n", __func__);
+        if (free_memory_map()) printf("%s: lm_free failed\n", __func__);
         return 1;
     }
 
-    if (free_memory()) {
+    if (free_memory_map()) {
         printf("%s: lm_free failed\n", __func__);
         return 1;
     }
@@ -294,7 +294,7 @@
     if (subscribe_kbc_interrupt(kbc_irq_bit, &kbc_id)) {
         if (vg_exit()) {
             printf("%s: vg_exit failed to exit to text mode.\n", __func__);
-            if (free_memory()) printf("%s: lm_free failed\n", __func__);
+            if (free_memory_map()) printf("%s: lm_free failed\n", __func__);
         }
         return 1;
     }
@@ -325,7 +325,7 @@
     if (unsubscribe_interrupt(&kbc_id)) {
         if (vg_exit()) {
             printf("%s: vg_exit failed to exit to text mode.\n", __func__);
-            if (free_memory()) printf("%s: lm_free failed\n", __func__);
+            if (free_memory_map()) printf("%s: lm_free failed\n", __func__);
         }
         return 1;
     };
@@ -332,11 +332,11 @@
 
     if (vg_exit()) {
         printf("%s: vg_exit failed to exit to text mode.\n", __func__);
-        if (free_memory()) printf("%s: lm_free failed\n", __func__);
+        if (free_memory_map()) printf("%s: lm_free failed\n", __func__);
         return 1;
     }
 
-    if (free_memory()) {
+    if (free_memory_map()) {
         printf("%s: lm_free failed\n", __func__);
         return 1;
     }
@@ -379,7 +379,7 @@
     if (subscribe_kbc_interrupt(kbc_irq_bit, &kbc_id)) {
         if (vg_exit()) {
             printf("%s: vg_exit failed to exit to text mode.\n", __func__);
-            if (free_memory()) printf("%s: lm_free failed\n", __func__);
+            if (free_memory_map()) printf("%s: lm_free failed\n", __func__);
         }
         return 1;
     }
@@ -449,7 +449,7 @@
     if (unsubscribe_interrupt(&kbc_id)) {
         if (vg_exit()) {
             printf("%s: vg_exit failed to exit to text mode.\n", __func__);
-            if (free_memory()) printf("%s: lm_free failed\n", __func__);
+            if (free_memory_map()) printf("%s: lm_free failed\n", __func__);
         }
         return 1;
     };
@@ -456,11 +456,11 @@
 
     if (vg_exit()) {
         printf("%s: vg_exit failed to exit to text mode.\n", __func__);
-        if (free_memory()) printf("%s: lm_free failed\n", __func__);
+        if (free_memory_map()) printf("%s: lm_free failed\n", __func__);
         return 1;
     }
 
-    if (free_memory()) {
+    if (free_memory_map()) {
         printf("%s: lm_free failed\n", __func__);
         return 1;
     }
