modified for C# mode.