Finalized C# sample