example code in c# that I wrote