writing main run loop
added main loop and group.mark_agent_as_dead()