while loop logic - C#