title: Getting Index out of range exception
body: <p>My Main problem is : if i add "N" group to company and check it in the last , i see all of "Man"s arrange into all of groups like together ?</p>
  
  <p>i this my problem is in the definition of class or references .</p>
  
  <p>This is my code :</p>
  
  <pre><code>    public class Man
      {
          public int Code { get; set; }
          public string Name { get; set; }
          public int Priority { get; set; }
          public int Stoptime { get; set; }
          public Boolean Lunch { get; set; }
          public DateTime Arrival { get; set; }
          public DateTime Departure { get; set; }
          public int LunchTime { get; set; }
      }
  
      public class Group
      {
          public List&lt;Man&gt; People { get; set; }
          public double Speed { get; set; }
          public double Rate { get; set; }
          public double Surcharge { get; set; }
          public double TotalRate { get; set; }
      }
      public class Company
      {
          public List&lt;Group&gt; Groups { get; set; }
          public Group BestGroup { get; set; }
          public double Rate { get; set; }
          public double Surcharge { get; set; }
          public double FullRate { get; set; }
      }
  
      private List&lt;Man&gt; ShufflePosts(List&lt;Man&gt; ShufflePeoples)
      {
          List&lt;Man&gt; Temp = ShufflePeoples;
          List&lt;Man&gt; Commixed = new List&lt;Man&gt;();
          Random rand = new Random();
          do
          {
              int shf = rand.Next(0, Temp.Count);
              Commixed.Add(Temp[shf]);
              Temp.RemoveAt(shf);
          } while (Temp.Count &gt; 1);
  
          Commixed.Add(Temp[0]);
          return Commixed;
      }
  
  
      public void CAStart(List&lt;Man&gt; Peoples)
      {
  
          var _Race = new Company();
          _Race.Groups = new List&lt;Group&gt;();
          for (int i = 0; i &lt; 5; i++)
          {
              var Gr = new Group();
              Gr.People = ShufflePosts(Peoples);
              _Race.Groups.Add(Gr);
          }
      }
  </code></pre>
  
  <p>In the code <code>Commixed.Add(Temp[0]);</code> VS show me error <strong>index out of range</strong>.
  I check the variable and see below data:</p>
  
  <p><code>ShufflePeoples.Count = 0, Temp.Count = 0, Commixed.Count = 1</code></p>
  
  <p>Why this happens ?
  Where is my problem ?</p>