// Perhaps this code repetition can also be improved... private bool WaitForSetup() { int waitingLoops = 0; System.Diagnostics.Debug.WriteLine("user in wait for setup: " + userName); while (!ActiveUsersList <NeatGenome> .IsUsersEvolutionReady(userName)) { System.Threading.Thread.Sleep(100); ++waitingLoops; if (waitingLoops > 200) { System.Diagnostics.Debug.WriteLine("Waiting for evolution algorithm to be ready timed out!"); return(false); } } return(true); }