convert to C#