Updated to C# from VB