Began conversion from vb.net to c#