Started conversion from c++ to c#