Added original C# codes.