Index: code/branches/formationupdate/data/levels/maxim.oxw
===================================================================
--- code/branches/formationupdate/data/levels/maxim.oxw	(revision 9620)
+++ code/branches/formationupdate/data/levels/maxim.oxw	(revision 9621)
@@ -20,5 +20,5 @@
 <Level
  gametype = "Mission"
->                 
+>                  
   <templates>
     <Template link=lodtemplate_default />
@@ -49,7 +49,10 @@
   <!-- TRIGGERS -->
     <DistanceTrigger name="FormationInit" position="800,700,600"  target="Pawn" distance=60 stayActive="true" delay=0.1 />
+    <DistanceTrigger name="LetsGo"        position="200,-200,1000" target="Pawn" distance=180 stayActive="true" delay=0.1 />
       <BlinkingBillboard colour="1,1,0.05"position="200,-200,1000" frequency=0.6 amplitude=3 material="Flares/lensflare" >
       </BlinkingBillboard>
-
+	<DistanceTrigger name="Fight"        position="-600,3000,-2000" target="Pawn" distance=180 stayActive="true" delay=0.1 />
+      <BlinkingBillboard colour="0,0,1"position="-600,3000,-2000" frequency=0.6 amplitude=3 material="Flares/lensflare" >
+      </BlinkingBillboard>
 
 
@@ -63,33 +66,68 @@
     </Script> <!-- !!! activates formation behaviour !!! -->
 
+    <Script code="artificialcontroller setbotlevel 3" onLoad="false">
+        <events>
+            <trigger>
+                <EventListener event=FormationInit />
+            </trigger>
+        </events>
+    </Script>
 
-	<!-- ADDING FORMATION: 5 Swallows -->
-	<?lua for i=0,1,1 do
-	?>
-	    <SpaceShip position="<?lua print(800+i*200) ?>,700,600" lookat="-1300,-600,900" visible="true">
-	        <templates>
-	            <Template link=spaceshipswallow /> 
-	        </templates>
-	        <controller>
-	            <AIController team=0/>
-	        </controller>
-	    </SpaceShip>
-	<?lua end ?>
-	
-	
-	<!-- ADDING ENEMY FORMATION: 5 Swallows -->
+    <SimpleNotification message="Let's go!">
+        <events>
+            <trigger>
+                <EventListener event="LetsGo" />
+            </trigger>
+        </events>
+    </SimpleNotification>
 
-	<?lua for i=0,1,1 do
-	?>
-	    <SpaceShip position="<?lua print(5000+i*200) ?>,-200,1000" lookat="-1300,-600,900" visible="true">
-	        <templates>
-	            <Template link=spaceshipswallow /> 
-	        </templates>
-	        <controller>
-	            <AIController team=1/>
-	        </controller>
-	    </SpaceShip>
-	<?lua end ?>
+
+
+
+<!-- ADDING FORMATION: 2 Swallows -->
+<?lua for i=0,1,1 do
+?>
+    <SpaceShip position="<?lua print(400+i*200) ?>,-200,1000" lookat="-1300,-600,900" visible="true">
+        <!--events>
+            <visibility>
+                <EventListener event="ondock" />
+            </visibility>
+        </events-->
+        <templates>
+            <Template link=spaceshipswallow /> <!--spaceshipTransporter spaceshippirate-->
+        </templates>
+        <controller>
+            <AIController team=0>
+                <events>
+                    <activity>
+                        <EventListener event="LetsGo" />
+                     </activity>
+                </events>
+            </AIController>
+        </controller>
+    </SpaceShip>
+<?lua end ?>
+
+<?lua for i=0,2,1 do
+?>
+
+
+<!-- ENEMY SWALLOWS -->
+    <SpaceShip position="<?lua print(-400+i*200) ?>,3000,-2000" lookat="-1300,-600,900" visible="true">
+        <templates>
+            <Template link=spaceshipswallow />
+        </templates>
+        <controller>
+            <AIController team=1>
+                <events>
+                    <activity>
+                        <EventListener event="Fight" />
+                     </activity>
+                </events>
+            </AIController>
+        </controller>
+    </SpaceShip>
+<?lua end ?>
+
   </Scene>
 </Level>
-
Index: code/branches/formationupdate/src/orxonox/controllers/FormationController.cc
===================================================================
--- code/branches/formationupdate/src/orxonox/controllers/FormationController.cc	(revision 9620)
+++ code/branches/formationupdate/src/orxonox/controllers/FormationController.cc	(revision 9621)
@@ -535,4 +535,5 @@
 
 
+    // Sets newMaster as the new master within the formation. Called by the master.
     void FormationController::setNewMasterWithinFormation(FormationController* newMaster)
         {
@@ -565,5 +566,5 @@
 
   /**
-        @brief Frees all slaves form a master. Initiated by a master.
+        @brief Frees all slaves from a master. Initiated by a master.
     */
     void FormationController::freeSlaves()
Index: code/branches/formationupdate/src/orxonox/controllers/FormationController.h
===================================================================
--- code/branches/formationupdate/src/orxonox/controllers/FormationController.h	(revision 9620)
+++ code/branches/formationupdate/src/orxonox/controllers/FormationController.h	(revision 9621)
@@ -59,5 +59,4 @@
       static void passivebehaviour(const bool passive);
       static void formationsize(const int size);
-      void setNewMasterWithinFormation();
       void setNewMasterWithinFormation(FormationController* newMaster);
 
@@ -100,7 +99,6 @@
       virtual void hit(Pawn* originator, btManifoldPoint& contactpoint, float damage);
 
-      /* Just for testing purposes: report the master. */
       FormationController* getMaster( void ) { return myMaster_; }
-      FormationController* getThis( void ) { return this; }
+      FormationController* getController( void ) { return this; }
       FormationController* getSlave( void ) { return this->slaves_.back(); }
 
@@ -136,4 +134,5 @@
       void takeLeadOfFormation();
       void loseMasterState();
+      void setNewMasterWithinFormation();
 
       void freeSlaves();
Index: code/branches/formationupdate/src/orxonox/worldentities/pawns/Pawn.cc
===================================================================
--- code/branches/formationupdate/src/orxonox/worldentities/pawns/Pawn.cc	(revision 9620)
+++ code/branches/formationupdate/src/orxonox/worldentities/pawns/Pawn.cc	(revision 9621)
@@ -309,7 +309,5 @@
 
 
-    /* Two functions to find the slaves of a Pawn
-     *
-     */
+    // A function to check if this pawn's controller is the master of any formationcontroller
     bool Pawn::hasSlaves()
     {
@@ -318,5 +316,5 @@
 			 it != ObjectList<FormationController>::end(); ++it )
 		{
-			// checks if the Pawn has a slave
+			// checks if the pawn's controller has a slave
 			if (this->hasHumanController() && it->getMaster() == this->getPlayer()->getController())
 				return true;
@@ -325,4 +323,5 @@
     }
 
+    // A function that returns a slave of the pawn's controller
     Controller* Pawn::getSlave(){
     	for (ObjectList<FormationController>::iterator it =
@@ -331,5 +330,5 @@
     	{
     		if (this->hasHumanController() && it->getMaster() == this->getPlayer()->getController())
-    			return it->getThis();
+    			return it->getController();
     	}
     	return 0;
@@ -353,6 +352,5 @@
             if (this->getPlayer() && this->getPlayer()->getControllableEntity() == this)
             {
-
-            	// Do different things if Pawn is the Master of a Formation
+            	// Start to control a new entity if you're the master of a formation
             	if(this->hasSlaves())
             	{
@@ -363,19 +361,9 @@
             		slave->setControllableEntity(0);
 
-
-            		// set new Master
+            		// set a new master within the formation
 					orxonox_cast<FormationController*>(this->getController())->setNewMasterWithinFormation(orxonox_cast<FormationController*>(slave));
-            		//orxonox_cast<FormationController*>(this->getController())->setNewMasterWithinFormation();
-
-
-            		/* TO DO: - setNewMasterWithinFormation() with an argument.
-            		 * 		  - set slave as the new master within the formation
-            		 *
-            		 */
 
 					// start to control a slave
     				this->getPlayer()->startControl(entity);
-
-
             	}
             	else
