More C# to CPP work