Confusing code with keyword ref - C#