Index: trunk/MagicSoft/Cosy/base/MStar.h
===================================================================
--- trunk/MagicSoft/Cosy/base/MStar.h	(revision 1793)
+++ trunk/MagicSoft/Cosy/base/MStar.h	(revision 1810)
@@ -21,4 +21,20 @@
     void Set(Double_t mx, Double_t my) { fX=mx; fY=my; }
 
+    Int_t Compare(const TObject *obj) const
+    {
+        const MStar *const s = (MStar*)obj;
+
+        if (fMag<s->fMag)
+            return -1;
+
+        if (fMag>s->fMag)
+            return 1;
+
+        return 0;
+    }
+
+    Bool_t IsSortable() const { return kTRUE; }
+
+
     ClassDef(MStar, 1)
 };
Index: trunk/MagicSoft/Cosy/base/MStarList.cc
===================================================================
--- trunk/MagicSoft/Cosy/base/MStarList.cc	(revision 1793)
+++ trunk/MagicSoft/Cosy/base/MStarList.cc	(revision 1810)
@@ -1,3 +1,5 @@
 #include "MStarList.h"
+
+#include <iostream.h>
 
 void MStarList::RemoveTwins(Double_t radius)
@@ -18,6 +20,7 @@
             return;
 
+        fStars.RemoveAt(idx);
+
         MStarListIter Next(this, *first, radius);
-        Delete(idx);
 
         MStar *pos;
@@ -29,5 +32,5 @@
             mx += pos->GetX();
             my += pos->GetY();
-            Delete(pos);
+            fStars.Remove(pos);
             cnt++;
         }
Index: trunk/MagicSoft/Cosy/base/MStarList.h
===================================================================
--- trunk/MagicSoft/Cosy/base/MStarList.h	(revision 1793)
+++ trunk/MagicSoft/Cosy/base/MStarList.h	(revision 1810)
@@ -38,4 +38,8 @@
 
     void RemoveTwins(Double_t radius);
+
+    void Sort() { fStars.Sort(); }
+
+    void Expand(int n) { fStars.Expand(n); }
 };
 
Index: trunk/MagicSoft/Cosy/base/timer.cc
===================================================================
--- trunk/MagicSoft/Cosy/base/timer.cc	(revision 1793)
+++ trunk/MagicSoft/Cosy/base/timer.cc	(revision 1810)
@@ -26,4 +26,11 @@
 //    fDiv = fmod((fMs+fSecs)/(60*60*24), 1.0);
 }
+
+void Timer::GetTimeval(struct timeval *tv) const
+{
+    tv->tv_sec  = fSecs;
+    tv->tv_usec = fMs;
+}
+
 /*
 void Timer::Set(const long mjd)
Index: trunk/MagicSoft/Cosy/base/timer.h
===================================================================
--- trunk/MagicSoft/Cosy/base/timer.h	(revision 1793)
+++ trunk/MagicSoft/Cosy/base/timer.h	(revision 1810)
@@ -33,4 +33,6 @@
     void SetTimer(const struct timeval *tv);
 
+    void GetTimeval(struct timeval *tv) const;
+
     int GetSecs() { return fSecs; }
 
