Index: proj/include/ent.h
===================================================================
--- proj/include/ent.h	(revision 304)
+++ proj/include/ent.h	(revision 305)
@@ -12,9 +12,10 @@
 double (ent_get_YLength)(void);
 
 typedef enum {
-    gunner_meelee,
-    gunner_ranged,
-    gunner_player
+    gunner_melee  = BIT(0),
+    gunner_ranged = BIT(1),
+    gunner_player = BIT(2),
+    gunner_follow = BIT(3)
 } gunner_type;
 
 struct gunner;
Index: proj/include/proj_macros.h
===================================================================
--- proj/include/proj_macros.h	(revision 304)
+++ proj/include/proj_macros.h	(revision 305)
@@ -26,7 +26,7 @@
 #define HIGHLIGHT_COLOR         0x404040
 #define DELIMITER_COLOR         0x404040
 
-#define MEELEE_RANGE    150
-#define MEELEE_DAMAGE   1
+#define MELEE_RANGE    150
+#define MELEE_DAMAGE   1
 
 #endif /* end of include guard: PROJ_MACROS_H_INCLUDED */
Index: proj/src/proj.c
===================================================================
--- proj/src/proj.c	(revision 304)
+++ proj/src/proj.c	(revision 305)
@@ -125,48 +125,48 @@
         if (is_ipc_notify(ipc_status)) { /* received notification */
             switch (_ENDPOINT_P(msg.m_source)) {
                 case HARDWARE: /* hardware interrupt notification */
-                    for (uint32_t i = 0, n = 1; i < 32; i++, n <<= 1) {
-                        if (msg.m_notify.interrupts & n) {
-                            interrupt_handler(i);
-                            switch (i) {
+                for (uint32_t i = 0, n = 1; i < 32; i++, n <<= 1) {
+                    if (msg.m_notify.interrupts & n) {
+                        interrupt_handler(i);
+                        switch (i) {
                             case TIMER0_IRQ:
 
-                                graph_clear_screen();
-                                switch(menu_update_state(main_menu, click)){
-                                    case -1: break;
-                                    case  0: singleplayer(); break; //campaign(); break;
-                                    case  1: break;
-                                    case  2: chat(); break;
-                                    case  3: good = false; break;
-                                }
-                                menu_draw(main_menu);
+                            graph_clear_screen();
+                            switch(menu_update_state(main_menu, click)){
+                                case -1: break;
+                                case  0: singleplayer(); break; //campaign(); break;
+                                case  1: break;
+                                case  2: chat(); break;
+                                case  3: good = false; break;
+                            }
+                            menu_draw(main_menu);
 
-                                click = 0;
+                            click = 0;
 
-                                sprite_set_pos(sp_crosshair, *get_mouse_X(), *get_mouse_Y());
-                                sprite_draw(sp_crosshair);
-                                graph_draw();
+                            sprite_set_pos(sp_crosshair, *get_mouse_X(), *get_mouse_Y());
+                            sprite_draw(sp_crosshair);
+                            graph_draw();
 
-                                break;
+                            break;
                             case KBC_IRQ:
-                                if ((scancode[0]) == ESC_BREAK_CODE) good = false;
+                            if ((scancode[0]) == ESC_BREAK_CODE) good = false;
                             case MOUSE_IRQ:
-                                if (counter_mouse_ih >= 3) {
-                                    mouse_parse_packet(packet_mouse_ih, &pp);
-                                    update_mouse(&pp);
-                                    if (!click) click = last_lb ^ keys->lb_pressed && keys->lb_pressed;
-                                    last_lb = keys->lb_pressed;
-                                    counter_mouse_ih = 0;
-                                }
-                                break;
+                            if (counter_mouse_ih >= 3) {
+                                mouse_parse_packet(packet_mouse_ih, &pp);
+                                update_mouse(&pp);
+                                if (!click) click = last_lb ^ keys->lb_pressed && keys->lb_pressed;
+                                last_lb = keys->lb_pressed;
+                                counter_mouse_ih = 0;
+                            }
+                            break;
                             case COM1_IRQ: nctp_ih(); break;
-                            }
                         }
                     }
+                }
 
-                    break;
+                break;
                 default:
-                    break; /* no other notifications expected: do nothing */
+                break; /* no other notifications expected: do nothing */
             }
         } else { /* received standart message, not a notification */
             /* no standart message expected: do nothing */
@@ -185,7 +185,7 @@
     // Unsubscribe interrupts
     if (unsubscribe_all()) {
         if (cleanup())
-            printf("%s: failed to cleanup.\n", __func__);
+        printf("%s: failed to cleanup.\n", __func__);
         return 1;
     }
 
@@ -224,7 +224,7 @@
             if (int_vector & n) {
                 interrupt_handler(i);
                 switch (i) {
-                case TIMER0_IRQ:
+                    case TIMER0_IRQ:
 
                     graph_clear_screen();
                     switch(menu_update_state(main_menu, click)){
@@ -242,9 +242,9 @@
                     graph_draw();
 
                     break;
-                case KBC_IRQ:
+                    case KBC_IRQ:
                     if ((scancode[0]) == ESC_BREAK_CODE) good = false;
-                case MOUSE_IRQ:
+                    case MOUSE_IRQ:
                     if (counter_mouse_ih >= 3) {
                         mouse_parse_packet(packet_mouse_ih, &pp);
                         update_mouse(&pp);
@@ -253,7 +253,7 @@
                         counter_mouse_ih = 0;
                     }
                     break;
-                case COM1_IRQ: nctp_ih(); break;
+                    case COM1_IRQ: nctp_ih(); break;
                 }
             }
         }
@@ -285,12 +285,12 @@
     list_t *bullet_list  = list_ctor();
 
     ent_set_origin(gunner_get_x(shooter1)-ent_get_XLength()/2.0,
-                   gunner_get_y(shooter1)-ent_get_YLength()/2.0);
+    gunner_get_y(shooter1)-ent_get_YLength()/2.0);
 
-   //uint32_t refresh_count_value = sys_hz() / REFRESH_RATE;
-   uint8_t last_lb = 0;
-   struct packet pp;
-   keys_t *keys = get_key_presses();
+    //uint32_t refresh_count_value = sys_hz() / REFRESH_RATE;
+    uint8_t last_lb = 0;
+    struct packet pp;
+    keys_t *keys = get_key_presses();
 
     /// loop stuff
     uint32_t int_vector = 0;
@@ -299,67 +299,67 @@
         /* Get a request message. */
         if((r = get_interrupts_vector(&int_vector))) return r;
         for (uint32_t i = 0, n = 1; i < 32; i++, n <<= 1) {
-           if (int_vector & n) {
-               interrupt_handler(i);
-               switch (i) {
-               case TIMER0_IRQ:
+            if (int_vector & n) {
+                interrupt_handler(i);
+                switch (i) {
+                    case TIMER0_IRQ:
 
-                   if (no_interrupts % 60 == 0) timer_update(in_game_timer);
-                   update_movement(map1, shooter1, keys, shooter_list);
+                    if (no_interrupts % 60 == 0) timer_update(in_game_timer);
+                    update_movement(map1, shooter1, keys, shooter_list);
 
-                   update_game_state(map1, shooter_list, bullet_list);
+                    update_game_state(map1, shooter_list, bullet_list);
 
-                   //update_scale();
-                   double angle = get_mouse_angle(shooter1);
-                   gunner_set_angle(shooter1, angle - M_PI_2);
+                    //update_scale();
+                    double angle = get_mouse_angle(shooter1);
+                    gunner_set_angle(shooter1, angle - M_PI_2);
 
-                   ent_set_origin(gunner_get_x(shooter1)-ent_get_XLength()/2.0,
-                                  gunner_get_y(shooter1)-ent_get_YLength()/2.0);
+                    ent_set_origin(gunner_get_x(shooter1)-ent_get_XLength()/2.0,
+                    gunner_get_y(shooter1)-ent_get_YLength()/2.0);
 
-                   graph_clear_screen();
-                   map_draw   (map1);
-                   bullet_draw_list(bullet_list);
-                   gunner_draw_list(shooter_list);
+                    graph_clear_screen();
+                    map_draw   (map1);
+                    bullet_draw_list(bullet_list);
+                    gunner_draw_list(shooter_list);
 
-                   text_draw(in_game_timer->text);
+                    text_draw(in_game_timer->text);
 
-                   sprite_set_pos(sp_crosshair, *get_mouse_X(), *get_mouse_Y());
-                   sprite_draw(sp_crosshair);
-                   graph_draw();
+                    sprite_set_pos(sp_crosshair, *get_mouse_X(), *get_mouse_Y());
+                    sprite_draw(sp_crosshair);
+                    graph_draw();
 
-                   break;
-               case KBC_IRQ:
-                   if ((scancode[0]) == ESC_BREAK_CODE) {
-                       good = false;
-                       // reset game
-                       while(list_size(bullet_list) > 0){
-                           bullet_t *p = (bullet_t*)list_erase(bullet_list, list_begin(bullet_list));
-                           bullet_dtor(p);
-                       }
-                       list_node_t *it = list_begin(shooter_list);
-                       while (it != list_end(shooter_list)) {
-                           gunner_t *p = *(gunner_t**)list_node_val(it);
-                           get_random_spawn(map1, p);
-                           gunner_set_curr_health(p, gunner_get_health(p));
-                           it = list_node_next(it);
-                       }
-                       timer_reset(in_game_timer);
-                   }
-                   break;
-               case MOUSE_IRQ:
-                   if (counter_mouse_ih >= 3) {
-                       mouse_parse_packet(packet_mouse_ih, &pp);
-                       update_mouse(&pp);
-                       if (last_lb ^ keys->lb_pressed && keys->lb_pressed)
-                           shoot_bullet(shooter1, bullet_list, bsp_bullet);
-                       last_lb = keys->lb_pressed;
-                       counter_mouse_ih = 0;
+                    break;
+                    case KBC_IRQ:
+                    if ((scancode[0]) == ESC_BREAK_CODE) {
+                        good = false;
+                        // reset game
+                        while(list_size(bullet_list) > 0){
+                            bullet_t *p = (bullet_t*)list_erase(bullet_list, list_begin(bullet_list));
+                            bullet_dtor(p);
+                        }
+                        list_node_t *it = list_begin(shooter_list);
+                        while (it != list_end(shooter_list)) {
+                            gunner_t *p = *(gunner_t**)list_node_val(it);
+                            get_random_spawn(map1, p);
+                            gunner_set_curr_health(p, gunner_get_health(p));
+                            it = list_node_next(it);
+                        }
+                        timer_reset(in_game_timer);
+                    }
+                    break;
+                    case MOUSE_IRQ:
+                    if (counter_mouse_ih >= 3) {
+                        mouse_parse_packet(packet_mouse_ih, &pp);
+                        update_mouse(&pp);
+                        if (last_lb ^ keys->lb_pressed && keys->lb_pressed)
+                        shoot_bullet(shooter1, bullet_list, bsp_bullet);
+                        last_lb = keys->lb_pressed;
+                        counter_mouse_ih = 0;
 
-                   }
-                   break;
-               case COM1_IRQ: nctp_ih(); break;
-               }
-           }
+                    }
+                    break;
+                    case COM1_IRQ: nctp_ih(); break;
+                }
+            }
         }
     }
 
@@ -393,8 +393,8 @@
     list_t *shooter_list = list_ctor();
 
     gunner_t *shooter1 = gunner_ctor(bsp_shooter, bsp_pistol, gunner_player, 1); if(shooter1 == NULL) printf("Failed to get shooter1\n");
-    gunner_set_spawn(shooter1, 75, 75);
-    gunner_set_pos(shooter1, 75, 75);
+    gunner_set_spawn(shooter1, 980, 790);
+    gunner_set_pos(shooter1, 980, 790);
 
     list_insert(shooter_list, list_end(shooter_list), shooter1);
 
@@ -401,12 +401,12 @@
     list_t *bullet_list  = list_ctor();
 
     ent_set_origin(gunner_get_x(shooter1)-ent_get_XLength()/2.0,
-                   gunner_get_y(shooter1)-ent_get_YLength()/2.0);
+    gunner_get_y(shooter1)-ent_get_YLength()/2.0);
 
-   //uint32_t refresh_count_value = sys_hz() / REFRESH_RATE;
-   uint8_t last_lb = 0;
-   struct packet pp;
-   keys_t *keys = get_key_presses();
+    //uint32_t refresh_count_value = sys_hz() / REFRESH_RATE;
+    uint8_t last_lb = 0;
+    struct packet pp;
+    keys_t *keys = get_key_presses();
 
     /// loop stuff
     uint32_t int_vector = 0;
@@ -420,82 +420,87 @@
         if((r = get_interrupts_vector(&int_vector))) return r;
         for (uint32_t i = 0, n = 1; i < 32; i++, n <<= 1) {
             if (int_vector & n) {
-               interrupt_handler(i);
-               switch (i) {
-               case TIMER0_IRQ: //printf("L463\n");
+                interrupt_handler(i);
+                switch (i) {
+                    case TIMER0_IRQ:
+                    if (no_interrupts % 60 == 0) timer_update(in_game_timer);
 
-                   if (no_interrupts % 60 == 0) timer_update(in_game_timer);//printf("L465\n");
-                   update_movement(map1, shooter1, keys, shooter_list);//printf("L466\n");
+                    clock_t t1, t2;
+                    t1 = clock();
 
-                   update_game_state(map1, shooter_list, bullet_list);//printf("L468\n");
+                    update_movement(map1, shooter1, keys, shooter_list);
 
-                   if(list_find(shooter_list, shooter1) == list_end(shooter_list)){
-                       good = false;
-                       dead = true;
-                       break;
-                   } //printf("L489\n");
+                    update_game_state(map1, shooter_list, bullet_list);
 
-                   //update_scale();
-                   double angle = get_mouse_angle(shooter1);//printf("L471\n");
-                   gunner_set_angle(shooter1, angle - M_PI_2); //printf("L472\n");
+                    if(list_find(shooter_list, shooter1) == list_end(shooter_list)){
+                        good = false;
+                        dead = true;
+                        break;
+                    }
 
-                   ent_set_origin(gunner_get_x(shooter1)-ent_get_XLength()/2.0,
-                                  gunner_get_y(shooter1)-ent_get_YLength()/2.0);
+                    double angle = get_mouse_angle(shooter1);
+                    gunner_set_angle(shooter1, angle - M_PI_2);
 
-                   while(list_size(shooter_list) < ZOMBIES_NUM){
-                       gunner_t *zombie = gunner_ctor(bsp_zombie, bsp_nothing, gunner_meelee, 3);
-                       gunner_set_health(zombie, health);
-                       gunner_set_curr_health(zombie, health);
-                       health *= ZOMBIE_HEALTH_FACTOR;
-                       get_random_spawn(map1, zombie);
-                       list_push_back(shooter_list, zombie);
-                   } //printf("L484\n");
+                    ent_set_origin(gunner_get_x(shooter1)-ent_get_XLength()/2.0,
+                                   gunner_get_y(shooter1)-ent_get_YLength()/2.0);
 
-                   graph_clear_screen();
-                   map_draw   (map1);
-                   bullet_draw_list(bullet_list);
-                   gunner_draw_list(shooter_list);
+                    while(list_size(shooter_list) < ZOMBIES_NUM){
+                        gunner_t *zombie = gunner_ctor(bsp_zombie, bsp_nothing, gunner_melee | gunner_follow, 3);
+                        gunner_set_health(zombie, health);
+                        gunner_set_curr_health(zombie, health);
+                        health *= ZOMBIE_HEALTH_FACTOR;
+                        get_random_spawn(map1, zombie);
+                        list_push_back(shooter_list, zombie);
+                    }
 
-                   text_draw(in_game_timer->text);
+                    graph_clear_screen();
+                    map_draw   (map1);
+                    bullet_draw_list(bullet_list);
+                    gunner_draw_list(shooter_list);
 
-                   sprite_set_pos(sp_crosshair, *get_mouse_X(), *get_mouse_Y());
-                   sprite_draw(sp_crosshair);
-                   graph_draw(); //printf("L508\n");
+                    text_draw(in_game_timer->text);
 
-                   break;
-               case KBC_IRQ:
-                   if ((scancode[0]) == ESC_BREAK_CODE) {
-                       good = false;
-                       // reset game
-                       while(list_size(bullet_list) > 0){
-                           bullet_t *p = (bullet_t*)list_erase(bullet_list, list_begin(bullet_list));
-                           bullet_dtor(p);
-                       }
-                       list_node_t *it = list_begin(shooter_list);
-                       while (it != list_end(shooter_list)) {
-                           gunner_t *p = *(gunner_t**)list_node_val(it);
-                           get_random_spawn(map1, p);
-                           gunner_set_curr_health(p, gunner_get_health(p));
-                           it = list_node_next(it);
-                       }
-                       timer_reset(in_game_timer);
-                   }
-                   break;
-               case MOUSE_IRQ:
-                   if (counter_mouse_ih >= 3) {
-                       mouse_parse_packet(packet_mouse_ih, &pp);
-                       update_mouse(&pp);
-                       if (last_lb ^ keys->lb_pressed && keys->lb_pressed)
-                           shoot_bullet(shooter1, bullet_list, bsp_bullet);
-                       last_lb = keys->lb_pressed;
-                       counter_mouse_ih = 0;
+                    sprite_set_pos(sp_crosshair, *get_mouse_X(), *get_mouse_Y());
+                    sprite_draw(sp_crosshair);
+                    graph_draw();
 
-                   }
-                   break;
-               case COM1_IRQ: nctp_ih(); break;
-               }
-           }
-       }
+                    t2 = clock();
+                    printf("%d microseconds\n", t2-t1);
+
+                    break;
+                    case KBC_IRQ:
+                    if ((scancode[0]) == ESC_BREAK_CODE) {
+                        good = false;
+                        // reset game
+                        while(list_size(bullet_list) > 0){
+                            bullet_t *p = (bullet_t*)list_erase(bullet_list, list_begin(bullet_list));
+                            bullet_dtor(p);
+                        }
+                        list_node_t *it = list_begin(shooter_list);
+                        while (it != list_end(shooter_list)) {
+                            gunner_t *p = *(gunner_t**)list_node_val(it);
+                            get_random_spawn(map1, p);
+                            gunner_set_curr_health(p, gunner_get_health(p));
+                            it = list_node_next(it);
+                        }
+                        timer_reset(in_game_timer);
+                    }
+                    break;
+                    case MOUSE_IRQ:
+                    if (counter_mouse_ih >= 3) {
+                        mouse_parse_packet(packet_mouse_ih, &pp);
+                        update_mouse(&pp);
+                        if (last_lb ^ keys->lb_pressed && keys->lb_pressed)
+                        shoot_bullet(shooter1, bullet_list, bsp_bullet);
+                        last_lb = keys->lb_pressed;
+                        counter_mouse_ih = 0;
+
+                    }
+                    break;
+                    case COM1_IRQ: nctp_ih(); break;
+                }
+            }
+        }
     }
 
     while(list_size(shooter_list) > 0){
@@ -529,21 +534,21 @@
     hltp_type tp = hltp_interpret(p, sz, &dest);
     switch(tp){
         case hltp_type_string:
-            strcpy(buffer2, dest);
-            strncat(buffer2, " <", 2);
-            for(size_t i = CHAT_MAX_NUM-1; i; --i)
-                text_set_text(t_text[i], text_get_string(t_text[i-1]));
-            text_set_text(t_text[0], buffer2);
-            for(size_t i = 0; i < CHAT_MAX_NUM; ++i){
-                if(text_get_string(t_text[i])[0] == '>'){
-                    text_set_pos(t_text[i], rectangle_get_x(r_text)+50, text_get_y(t_text[i]));
-                    text_set_halign(t_text[i], text_halign_left);
-                }else{
-                    text_set_pos(t_text[i], rectangle_get_x(r_text)+rectangle_get_w(r_text)-50, text_get_y(t_text[i]));
-                    text_set_halign(t_text[i], text_halign_right);
-                }
+        strcpy(buffer2, dest);
+        strncat(buffer2, " <", 2);
+        for(size_t i = CHAT_MAX_NUM-1; i; --i)
+        text_set_text(t_text[i], text_get_string(t_text[i-1]));
+        text_set_text(t_text[0], buffer2);
+        for(size_t i = 0; i < CHAT_MAX_NUM; ++i){
+            if(text_get_string(t_text[i])[0] == '>'){
+                text_set_pos(t_text[i], rectangle_get_x(r_text)+50, text_get_y(t_text[i]));
+                text_set_halign(t_text[i], text_halign_left);
+            }else{
+                text_set_pos(t_text[i], rectangle_get_x(r_text)+rectangle_get_w(r_text)-50, text_get_y(t_text[i]));
+                text_set_halign(t_text[i], text_halign_right);
             }
-            break;
+        }
+        break;
         default: break;
     }
 }
@@ -559,7 +564,7 @@
     rectangle_t *r_buffer = NULL; {
         r_buffer = rectangle_ctor(0,0,900,70);
         rectangle_set_pos(r_buffer, graph_get_XRes()/2  -rectangle_get_w(r_buffer)/2,
-                                    graph_get_YRes()*0.87-rectangle_get_h(r_buffer)/2);
+        graph_get_YRes()*0.87-rectangle_get_h(r_buffer)/2);
         rectangle_set_fill_color   (r_buffer, GRAPH_BLACK);
         rectangle_set_outline_width(r_buffer, 2);
         rectangle_set_outline_color(r_buffer, GRAPH_WHITE);
@@ -568,7 +573,7 @@
     text_t      *t_buffer = NULL; {
         t_buffer = text_ctor(consolas, "");
         text_set_pos(t_buffer, rectangle_get_x(r_buffer)+50,
-                               rectangle_get_y(r_buffer)+rectangle_get_h(r_buffer)/2);
+        rectangle_get_y(r_buffer)+rectangle_get_h(r_buffer)/2);
         text_set_halign(t_buffer, text_halign_left);
         text_set_valign(t_buffer, text_valign_center);
         text_set_color (t_buffer, TEXT_COLOR);
@@ -576,7 +581,7 @@
     text_t      *t_size   = NULL; {
         t_size = text_ctor(consolas, "");
         text_set_pos(t_size, rectangle_get_x(r_buffer)+rectangle_get_w(r_buffer)-5,
-                             rectangle_get_y(r_buffer)+rectangle_get_h(r_buffer)-5);
+        rectangle_get_y(r_buffer)+rectangle_get_h(r_buffer)-5);
         text_set_halign(t_size, text_halign_right);
         text_set_valign(t_size, text_valign_bottom);
         text_set_color (t_size, TEXT_COLOR);
@@ -587,100 +592,100 @@
     }
 
     /** r_text */ {
-        r_text = rectangle_ctor(0,0,900,550);
-        rectangle_set_pos(r_text, graph_get_XRes()/2  -rectangle_get_w(r_buffer)/2,
-                                  graph_get_YRes()*0.09);
-        rectangle_set_fill_color   (r_text, GRAPH_BLACK);
-        rectangle_set_outline_width(r_text, 2);
-        rectangle_set_outline_color(r_text, GRAPH_WHITE);
-        rectangle_set_fill_trans(r_text, GRAPH_TRANSPARENT);
-    }
-    /** t_text */ {
-        for(size_t i = 0; i < CHAT_MAX_NUM; ++i){
-            t_text[i] = text_ctor(consolas, " ");
-            text_set_pos(t_text[i], rectangle_get_x(r_text)+50,
-                                       rectangle_get_y(r_text)+rectangle_get_h(r_text)-30-25*i);
-            text_set_halign(t_text[i], text_halign_left);
-            text_set_valign(t_text[i], text_valign_bottom);
-            text_set_color (t_text[i], TEXT_COLOR);
-        }
-    }
+    r_text = rectangle_ctor(0,0,900,550);
+    rectangle_set_pos(r_text, graph_get_XRes()/2  -rectangle_get_w(r_buffer)/2,
+    graph_get_YRes()*0.09);
+    rectangle_set_fill_color   (r_text, GRAPH_BLACK);
+    rectangle_set_outline_width(r_text, 2);
+    rectangle_set_outline_color(r_text, GRAPH_WHITE);
+    rectangle_set_fill_trans(r_text, GRAPH_TRANSPARENT);
+}
+/** t_text */ {
+for(size_t i = 0; i < CHAT_MAX_NUM; ++i){
+    t_text[i] = text_ctor(consolas, " ");
+    text_set_pos(t_text[i], rectangle_get_x(r_text)+50,
+    rectangle_get_y(r_text)+rectangle_get_h(r_text)-30-25*i);
+    text_set_halign(t_text[i], text_halign_left);
+    text_set_valign(t_text[i], text_valign_bottom);
+    text_set_color (t_text[i], TEXT_COLOR);
+}
+}
 
-    /// loop stuff
-    uint32_t int_vector = 0;
-    int good = true;
-    while (good) {
-        /* Get a request message. */
-        if((r = get_interrupts_vector(&int_vector))) return r;
-        for (uint32_t i = 0, n = 1; i < 32; i++, n <<= 1) {
-            if (int_vector & n) {
-                interrupt_handler(i);
-                switch (i) {
+/// loop stuff
+uint32_t int_vector = 0;
+int good = true;
+while (good) {
+    /* Get a request message. */
+    if((r = get_interrupts_vector(&int_vector))) return r;
+    for (uint32_t i = 0, n = 1; i < 32; i++, n <<= 1) {
+        if (int_vector & n) {
+            interrupt_handler(i);
+            switch (i) {
                 case TIMER0_IRQ:
-                    graph_clear_screen();
-                    sprite_set_pos(sp_crosshair, *get_mouse_X(), *get_mouse_Y());
+                graph_clear_screen();
+                sprite_set_pos(sp_crosshair, *get_mouse_X(), *get_mouse_Y());
 
-                    rectangle_draw(r_buffer);
-                    text_draw(t_buffer);
-                    text_draw(t_size);
+                rectangle_draw(r_buffer);
+                text_draw(t_buffer);
+                text_draw(t_size);
 
-                    rectangle_draw(r_text);
-                    for(size_t i = 0; i < CHAT_MAX_NUM; ++i) text_draw(t_text[i]);
+                rectangle_draw(r_text);
+                for(size_t i = 0; i < CHAT_MAX_NUM; ++i) text_draw(t_text[i]);
 
-                    sprite_draw(sp_crosshair);
-                    graph_draw();
-                    break;
+                sprite_draw(sp_crosshair);
+                graph_draw();
+                break;
                 case KBC_IRQ:
-                    if      (scancode[0] == ESC_BREAK_CODE) good = false;
-                    else if (scancode[0] == ENTER_MAKE_CODE) {
-                        hltp_send_string(buffer);
-                        char buffer2[CHAT_MAX_SIZE+3] = "> ";
-                        strncat(buffer2, buffer, strlen(buffer));
-                        for(size_t i = CHAT_MAX_NUM-1; i; --i)
-                            text_set_text(t_text[i], text_get_string(t_text[i-1]));
-                        text_set_text(t_text[0], buffer2);
-                        for(size_t i = 0; i < CHAT_MAX_NUM; ++i){
-                            if(text_get_string(t_text[i])[0] == '>'){
-                                text_set_pos(t_text[i], rectangle_get_x(r_text)+50, text_get_y(t_text[i]));
-                                text_set_halign(t_text[i], text_halign_left);
-                            }else{
-                                text_set_pos(t_text[i], rectangle_get_x(r_text)+rectangle_get_w(r_text)-50, text_get_y(t_text[i]));
-                                text_set_halign(t_text[i], text_halign_right);
-                            }
+                if      (scancode[0] == ESC_BREAK_CODE) good = false;
+                else if (scancode[0] == ENTER_MAKE_CODE) {
+                    hltp_send_string(buffer);
+                    char buffer2[CHAT_MAX_SIZE+3] = "> ";
+                    strncat(buffer2, buffer, strlen(buffer));
+                    for(size_t i = CHAT_MAX_NUM-1; i; --i)
+                    text_set_text(t_text[i], text_get_string(t_text[i-1]));
+                    text_set_text(t_text[0], buffer2);
+                    for(size_t i = 0; i < CHAT_MAX_NUM; ++i){
+                        if(text_get_string(t_text[i])[0] == '>'){
+                            text_set_pos(t_text[i], rectangle_get_x(r_text)+50, text_get_y(t_text[i]));
+                            text_set_halign(t_text[i], text_halign_left);
+                        }else{
+                            text_set_pos(t_text[i], rectangle_get_x(r_text)+rectangle_get_w(r_text)-50, text_get_y(t_text[i]));
+                            text_set_halign(t_text[i], text_halign_right);
                         }
-                        buffer[0] = '\0';
-                    } else if(scancode[0] == BACKSPACE_MAKE_CODE){
-                        buffer[strlen(buffer)-1] = '\0';
-                    } else {
-                        char c = map_makecode(scancode[0]);
-                        if (c == ERROR_CODE) break;
-                        if(strlen(buffer) < CHAT_MAX_SIZE) strncat(buffer, &c, 1);
-                        else                               printf("Char limit exceeded\n");
                     }
-                    text_set_text(t_buffer, buffer);
-                    char buffer2[20];
-                    sprintf(buffer2, "%d/%d", strlen(buffer), CHAT_MAX_SIZE);
-                    text_set_text(t_size, buffer2);
+                    buffer[0] = '\0';
+                } else if(scancode[0] == BACKSPACE_MAKE_CODE){
+                    buffer[strlen(buffer)-1] = '\0';
+                } else {
+                    char c = map_makecode(scancode[0]);
+                    if (c == ERROR_CODE) break;
+                    if(strlen(buffer) < CHAT_MAX_SIZE) strncat(buffer, &c, 1);
+                    else                               printf("Char limit exceeded\n");
+                }
+                text_set_text(t_buffer, buffer);
+                char buffer2[20];
+                sprintf(buffer2, "%d/%d", strlen(buffer), CHAT_MAX_SIZE);
+                text_set_text(t_size, buffer2);
                 case MOUSE_IRQ:
-                    if (counter_mouse_ih >= 3) {
-                        mouse_parse_packet(packet_mouse_ih, &pp);
-                        update_mouse(&pp);
-                        counter_mouse_ih = 0;
-                    }
-                    break;
+                if (counter_mouse_ih >= 3) {
+                    mouse_parse_packet(packet_mouse_ih, &pp);
+                    update_mouse(&pp);
+                    counter_mouse_ih = 0;
+                }
+                break;
                 case COM1_IRQ: nctp_ih(); break;
-                }
             }
         }
     }
+}
 
-    rectangle_dtor(r_buffer);
-    text_dtor     (t_buffer);
+rectangle_dtor(r_buffer);
+text_dtor     (t_buffer);
 
-    rectangle_dtor(r_text);
-    for(size_t i = 0; i < CHAT_MAX_NUM; ++i) text_dtor(t_text[i]);
+rectangle_dtor(r_text);
+for(size_t i = 0; i < CHAT_MAX_NUM; ++i) text_dtor(t_text[i]);
 
-    nctp_set_processor(NULL);
+nctp_set_processor(NULL);
 
-    return SUCCESS;
+return SUCCESS;
 }
Index: proj/src/proj_func.c
===================================================================
--- proj/src/proj_func.c	(revision 304)
+++ proj/src/proj_func.c	(revision 305)
@@ -130,16 +130,16 @@
         /// Advance iterator if necessary
         bullet_it = list_node_next(bullet_it);
     }
-    /// MEELEE
+    /// MELEE
     list_node_t *it1 = list_begin(shooter_list);
     while(it1 != list_end(shooter_list)){
         gunner_t *s1 = *list_node_val(it1);
-        if(gunner_get_type(s1) != gunner_meelee){ it1 = list_node_next(it1); continue; }
+        if(!(gunner_get_type(s1) & gunner_melee)){ it1 = list_node_next(it1); continue; }
         list_node_t *it2 = list_begin(shooter_list);
         while(it2 != list_end(shooter_list)){
             gunner_t *s2 = *list_node_val(it2);
-            if(s1 != s2 && gunner_distance(s1, s2) < MEELEE_RANGE)
-                gunner_set_curr_health(s2, gunner_get_curr_health(s2) - MEELEE_DAMAGE);
+            if(s1 != s2 && gunner_distance(s1, s2) < MELEE_RANGE)
+                gunner_set_curr_health(s2, gunner_get_curr_health(s2) - MELEE_DAMAGE);
             if(gunner_get_curr_health(s2) <= 0){
                 list_node_t *aux = list_node_next(it2);
                 gunner_dtor(list_erase(shooter_list, it2));
Index: proj/Makefile
===================================================================
--- proj/Makefile	(revision 304)
+++ proj/Makefile	(revision 305)
@@ -12,7 +12,7 @@
 SRCS= proj.c list.c queue.c graph.c kbc.c keyboard.c mouse.c utils.c timer.c interrupts_func.c proj_func.c fast_math.c rectangle.c font.c xpm_utils.c ent.c rtc.c uart.c hltp.c makecode_map.c menu.c
 IPATHS=-I./include -I./libs/graph/include -I./libs/kbc/include -I./libs/rtc/include -I./libs/timer/include -I./libs/uart/include -I./libs/classes/include -I./libs/utils/include -I./maps -I./media/xpm
 
-CPPFLAGS += -pedantic ${IPATHS} -D LCOM_MACRO #-D __LCOM_OPTIMIZED_
+CPPFLAGS += -pedantic ${IPATHS} -D LCOM_MACRO -D __LCOM_OPTIMIZED_
 
 
 DPADD += ${LIBLCF}
