C# Implementation

Still could use work, but a basic port to C#.