Finished C# Conversion