Index: branches/presentation/src/lib/network/player_stats.cc
===================================================================
--- branches/presentation/src/lib/network/player_stats.cc	(revision 9071)
+++ branches/presentation/src/lib/network/player_stats.cc	(revision 9072)
@@ -238,2 +238,35 @@
 }
 
+
+
+ScoreList PlayerStats::getScoreList( )
+{
+  ScoreList result;
+  
+  const std::list<BaseObject*> * list = ClassList::getList( CL_PLAYER_STATS );
+  
+  if ( !list )
+  {
+    return result;
+  }
+  
+  for ( std::list<BaseObject*>::const_iterator it = list->begin(); it != list->end(); it++ )
+  {
+    PlayerStats & stats = *dynamic_cast<PlayerStats*>(*it);
+    
+    TeamScoreList::iterator it = result[stats.getTeamId()].begin();
+    
+    while (  it != result[stats.getTeamId()].end() && stats.score > it->score )
+    {
+      it++;
+    }
+    
+    PlayerScore score;
+    score.name = stats.getNickName();
+    score.score = stats.getScore();
+    
+    result[stats.getTeamId()].insert(it, score);
+  }
+  
+  return result;
+}
Index: branches/presentation/src/lib/network/player_stats.h
===================================================================
--- branches/presentation/src/lib/network/player_stats.h	(revision 9071)
+++ branches/presentation/src/lib/network/player_stats.h	(revision 9072)
@@ -20,4 +20,12 @@
   TEAM_SPECTATOR = -1
 };
+
+struct PlayerScore
+{
+  std::string name;
+  int score;
+};
+typedef std::list<PlayerScore> TeamScoreList;
+typedef std::map<int,TeamScoreList> ScoreList;
 
 //! A class for storing player information
@@ -62,4 +70,6 @@
     
     static void deleteAllPlayerStats();
+    
+    static ScoreList getScoreList();
 
   private:
Index: branches/presentation/src/util/multiplayer_team_deathmatch.cc
===================================================================
--- branches/presentation/src/util/multiplayer_team_deathmatch.cc	(revision 9071)
+++ branches/presentation/src/util/multiplayer_team_deathmatch.cc	(revision 9072)
@@ -541,5 +541,5 @@
       this->hideStats();
     }
-    if ( !this->statsBox && event.bPressed )
+    else if ( !this->statsBox && event.bPressed )
     {
       PRINTF(0)("show stats\n");
@@ -616,7 +616,7 @@
 {
   statsBox = new OrxGui::GLGuiBox();
-  statsBox->setAbsCoor2D( 300, 100 );
-
-  this->table = new OrxGui::GLGuiTable(5,5);
+  statsBox->setAbsCoor2D( 100, 100 );
+
+  this->table = new OrxGui::GLGuiTable(10,5);
 
   statsBox->pack( this->table );
@@ -646,54 +646,35 @@
 
   std::vector<std::string> headers;
+  headers.push_back("Blue Team");
+  headers.push_back("");
+  headers.push_back("");
   headers.push_back("Red Team");
   headers.push_back("");
-  headers.push_back("");
-  headers.push_back("Blue Team");
-  headers.push_back("");
   this->table->setHeader(headers);
 
-  std::map<int,std::string> fragsTeam0;
-  std::map<int,std::string> fragsTeam1;
-
-  const std::list<BaseObject*> * list = ClassList::getList( CL_PLAYER_STATS );
-
-  if ( !list )
-    return;
-
-  for ( std::list<BaseObject*>::const_iterator it = list->begin(); it != list->end(); it++ )
-  {
-    PlayerStats & stats = *dynamic_cast<PlayerStats*>(*it);
-
-    if ( stats.getTeamId() == 0 || stats.getTeamId() == 1 )
-    {
-      if ( stats.getTeamId() == 0 )
-        fragsTeam0[stats.getScore()] = stats.getNickName();
-      else
-        fragsTeam1[stats.getScore()] = stats.getNickName();
-    }
-  }
+  ScoreList scoreList = PlayerStats::getScoreList();
 
   char st[10];
   int i = 0;
-
-
+  
   i = 2;
-  for ( std::map<int,std::string>::const_iterator it = fragsTeam0.begin(); it != fragsTeam0.end(); it++ )
-  {
-    this->table->setEntry( 0, i, it->second );
-    snprintf( st, 10, "%d", it->first );
-    this->table->setEntry( 1, i, st );
-    this->table->setEntry( 2, i, "" );
+  for ( TeamScoreList::const_iterator it = scoreList[0].begin(); it != scoreList[0].end(); it++ )
+  {
+    this->table->setEntry( i, 0, it->name );
+    snprintf( st, 10, "%d", it->score );
+    this->table->setEntry( i, 1, st );
+    this->table->setEntry( i, 2, "" );
     i++;
   }
 
   i = 2;
-  for ( std::map<int,std::string>::const_iterator it = fragsTeam1.begin(); it != fragsTeam1.end(); it++ )
-  {
-    this->table->setEntry( 3, i, it->second );
-    snprintf( st, 10, "%d", it->first );
-    this->table->setEntry( 4, i, st );
+  for ( TeamScoreList::const_iterator it = scoreList[1].begin(); it != scoreList[1].end(); it++ )
+  {
+    this->table->setEntry( i, 3, it->name );
+    snprintf( st, 10, "%d", it->score );
+    this->table->setEntry( i, 4, st );
     i++;
   }
+
 }
 
