Adding Scott Kornish's C# solution