     }
     else
     {
-      play_gol();
+      if(play_gol()) //no generation change
+      {
+        if(++same > 50) //no change since 50 runs-> restart
+        {
+          same = 0;
+          init_gol();
+        }
+      }
+      else
+      {
+        same = 0;
+      }
       draw_gol();
     }
 

}


void play_gol(void)
{
  uint8_t x, y, count;

  //update cells
  for(x=0; x < X_SIZE; x++)

  {
    init_gol();
  }

  return same;
}


